Hi guys, I was wondering what is the quickest method for turning a port high and then low?
for example the following code:
#includevoid main() { DDRB = 0XFF; while(1) { PORTB = 0x00; PORTB = 0XFF; } return; }
with the ATmega328p set at 20MHz I got the following reading on a logic analyzer:
http://www.tinkerjunkies.com/Sample1.html
you'll notice the port stays high for 0.8us and low for only about 0.2us.
I noticed when i reversed the order and had PORTB = 0xFF first and then 0x00 I had a slightly better response time.
Is there a better method that updates a bit quicker?
Thanks!