Go Down

Topic: RE: Default Rx / Tx Shouldn't this be changed? (Read 660 times) previous topic - next topic

pracas

Mar 04, 2009, 06:02 pm Last Edit: Mar 04, 2009, 06:03 pm by pracas Reason: 1
Is there a specific reason why Rx and Tx are connected to pin 0 & pin 1 by defualt? why not move them to pin 12 &13? Recently i've run into a couple of devices that take/give 8 bit parallel data(encoders/decoders) and i think having complete access to PORTD with no disturbance to Serial Monitoring would be of great help. I know i can use a Shiftout / Shiftin Register to tackle this but I think a feature on the board would help a lot. perhaps my next design is gonna have this ;) Finally will simply changing the rx/tx lines on the pcb layout do the trick or should i play around with the bootloader/Arduino IDE aswell?
Be The Change...

halley

#1
Mar 04, 2009, 06:18 pm Last Edit: Mar 04, 2009, 06:20 pm by halley Reason: 1
The support for hardware serial is not defined by the printed circuit board, but by the ATmega8, ATmega168, ATmega328 design itself.  The only way to change these would be to ask Atmel to design the next chip differently.

http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf

Please familiarize yourself with the capabilities of the chip.  "Programmable USART" is mentioned many times, and refers to the hardware serial interface.

All of the specialized I/O features overlap with various general I/O pins.  Such is the nature of the microcontroller line.  They wanted the maximum flexibility with the minimum pin count.  Pins dedicated to just one feature are costly.

mekon83

It's not a big deal, you can combine PORTD and PORTB easily, say pins 2-9 (not tested  ;)):
to read:
readbyte = (PORTD >> 2) | (PORTB << 6);

to write:
PORTD = (PORTD & 3) | (writebyte << 2);
PORTB = (PORTB & 0xfc) | (writebyte >> 6);

It's not as neat as PORTD = writebyte, but still fine =)

pracas

#3
Mar 04, 2009, 06:35 pm Last Edit: Mar 04, 2009, 06:39 pm by pracas Reason: 1
oops halley, Thanks I didnt know that...  :-/ and all the while i was thinking it was something to do with arduino.

Thanks mekon, i can do that...
Be The Change...

mekon83

don't worry. happens to me all the time. But remember, compiler errors are usually coder's fault  :)

Go Up