Go Down

Topic: Tx/Rx as digitals on Mini (Read 1 time) previous topic - next topic

WizenedEE


I recently had a similar need for more I/O pins ;-)

You can do it, but you must disable the UART the 'hard way'. It is activated by default and overrides the pin-direction (input/output) internally in hardware. Once you've disabled it you cannot use any hardware serial communication anymore (in that program).

Insert this at the very beginning of setup()

Code: [Select]
UCSR0A = 0x00;
UCSR0B = 0x00;
UCSR0C = 0x03;


This sets the uart control & status registers to their default values and turns the uart + port override off.


At the end of the arduino init() function it does this.

magnethead794


That data was taken with the collector wired to Vcc and the emitter to GND + amp-meter in there.

Anyhow, it needs 5V to turn on fully. If you only need 40mA per channel that is of less a concern.

Maybe this datasheet is a bit clearer on how the values were obtained:

http://www.datasheetcatalog.org/datasheet/allegromicrosystems/2801.pdf


got it now
KF5RVR

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy