I am making an LED cube but controling it with my arduino would require using PORTD as an 8-bit data output. (As in Cher's example program)
However, since pin 0 is in port D and it usually receive serial programming as an input pin, doesn't this mean I'll never be able to reprogram my arduino again? Is there any way around this?
Unfortunately port D is the only one with all 8 pins usable.
So I'll be able to reprogram the arduino normally via the USB even if i set PORTD, including pin 0, as output in my program? How does that work?
The FTDI chip may not be able to drive pin 0 high if a load (LED ?) is also connected and if so, serial programming will not work and you may damage the FTDI chip. If the pin is used as a control signal, you're not likley to see any issue. If the pin is used to source power to a LED however, your concerns are valid.
The FTDI chip may not be able to drive pin 0 high if a load (LED ?) is also connected and if so, serial programming will not work
Correct, because of the series 1k ohm resistor from the FTDI output pin to the arduino rec pin, the FTDI will not be able to overcome very much of any additional load burden from external components like an LED/resistor wired to pin 0.
and you may damage the FTDI chip.
Not likely, those 1k ohm isolation resistors will pretty much protect the FTDI chip from damage.
retrolefty:
Not likely, those 1k ohm isolation resistors will pretty much protect the FTDI chip from damage.
True, my concern is if you bypass the 1k resistor as max current for the FTDI chip is 16mA. This would be within spec for the Arduino, but "unhealthy" for the FTDI chip.
True, my concern is if you bypass the 1k resistor as max current for the FTDI chip is 16mA. This would be within spec for the Arduino, but "unhealthy" for the FTDI chip.
Unhealthy for sure. If one was using pin 0 as a output pin and set it low, without the resistor, the FTDI pin and Arduino pin would be both seeing a short circuit from Vcc to ground through both pins. The 1K resistors are a requirement for any arduino compatible design that has a FTDI or 8u2 converter wired to pins 0 and 1.
Disconnect the LED/resistor from pin 0 when you want to upload a program. Then reconnect it when you want to run the program.
Drive the LED using a transistor or small mosfet (e.g. 2N7000) so that the load is small and the 1K series resistor can easily drive it during programming.