Go Down

Topic: Arduino mega r3 PORTL PORTK PORTF (Read 164 times) previous topic - next topic

Paulzippo

Apologies in advance if the answer is already here (somewhere) having searched the galaxy.

Before I part with cash for an Arduino mega r3 - which has all the ports I need in the configuration I need i.e. ports that are 8 bits wide, can anyone who has an r3 categorically confirm that you can write to all 8 bits in one go with a statements like:

// in the setup section

// setup direction
DDRL = B11111111;   Hopefull this means set ALL PORTL to outputs

And in the loop section

PORTL = B11111111 // set all PORTL pins HIGH or instead use 0xFF in place of the B and 1's
delay(1000);
PORTL = B00000000 // set all PORTL pins LOW or use 0x00 in place of the B and 0's


Only asking because in my quest to find the answer - some are saying this doesn't work on PORTL and K not to mention F

And therefore not point in wasting my money.

Wawa

If money is an issue, then why not use a $0.20 74HC595 serial to 8-bit parallel shift register.
Leo..

Delta_G

some are saying this doesn't work on PORTL and K not to mention F
Where you hear that?
If at first you don't succeed, up - home - sudo - enter.

CrossRoads

All of ports F, K, and L are  brought out to Mega header pins.

Direct port manipulation of all pins are thus possible.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Paulzippo

Thanks to all who responded.

I have had it confirmed that you can manipulate the ports mentioned directly.

Go Up