Changing default rx/tx pins for serial communicati

I have a project where i need to read parallel a 8 bit data. I was initially using different pins and a bit of code to do this now I’m thinking of using Port Manipulation however i see that only PORT D provides access to 8 bits now of these pins 0 & 1 are configured for Serial Port. Can I change this? say can i configure pins 12,13 as rx, tx and connect them to my serial port using an rs232 cable? will this create any errors? and can i simply change the destination port to the rs232 port and monitor the serial data? i’m planning to use the NewSoftSerial library on a Diecimila with an Atmega168 on Win XP


pins 0 & 1 are configured for Serial Port. Can I change this?

No. The ATmega’s UART is hardwired to those pins.

You may be able to use software serial (or new software serial), though, to bit-bang your serial port.

You could probably use the high 6 bits of port D and the low 2 of port B (arduino pins 2-9), and do a couple of bit shifts to roll it into a single byte. Not as clean as what you want, but keeps the hardware UART free…


and i forgot i would need a converter between the rx/tx and the rs232! … but i suppose if i sacrifice serial communication i can get 8bit access.

have you looked into instead using the 74HC165 for this? I imagine that would be easier and give some flexibility as far using remaining pins for future ideas.

even if you want to read each of the 8 bits as a separate variable, this code can be modified to read and store bits instead of bytes.

yes i have used it. i know i cna use shift registers but was looking to explore direct to arduino possibilities.