While tinkering i thought i would test out the capabilities on the Duemilanove, this is that i found, using the blink sketch example and taking out the delays pin 13 toggles at 126.2Khz, nothing exciting there but talking to pin 13 direct

void loop() { PORTB =32; PORTB = 0;}and pin 13 toggles at 1.223Mhz now that is interesting.so it take 13 clock cycles to execute the above code, i bet doing the same in ASM will toggle pin 13 even faster,oh well bored testing that now, just thought i'd mention it

it's not a problem graymalkin, it's just the way compilers work by including so much useless code into the resulting hex file, normally speed isn't a problem in everyday coding but there are situations where speed is everything and timing is critical which is where assembly code and talking to the hardware direct is useful.

I think your missing the point of the Arduino I/O statements. They were able to build in a abstraction of the I/O port/pin addresses and there secondary functions. That results in having Arduino pin 13 be the same regardless of what port and pin or special additional features a specific AVR processor I/O pin has. Therefore it becomes portable over the Arduino board offerings. Their thought was this abstraction would be easier for non-programmers to start with. However one is free to utilize direct port access to I/O pins at the expensive of portability. It's convenient to be able to have the choice, as direct I/O can be beneficial at times, as say inside a ISR function where code speed is important.

I don't think that the abstraction should be removed, but it would be nice for there to be the option to skip past it with preference to speed, eg digitalWrite(PortName, state, 1) to be an override of digitalWrite(PinNumber, State)

I don't think that the abstraction should be removed, but it would be nice for there to be the option to skip past it with preference to speed, eg digitalWrite(PortName, state, 1) to be an override of digitalWrite(PinNumber, State)

I do believe the Arduino team is working on a fast digitalRead and write functions. possibly released with the version 1 project?

I hope no-one thinks im running down the Arduino developers or digitalwrite, im not, all i did was see how fast one pin could switch and ways to make it go faster, i used to be a PIC fan and still am but since getting two duinos and a bunch of shields i now really like the platform for ease of development