Pages: 1 [2]   Go Down
Author Topic: Tx/Rx as digitals on Mini  (Read 799 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Edison Member
*
Karma: 17
Posts: 1041
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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.
Logged

Ft. Worth, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 591
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

KF5RVR

Pages: 1 [2]   Go Up
Jump to: