What is the easiest way to create a register from an input serial command?

Status
Not open for further replies.

Steve311

Member
Hi All,
What is the easiest way to create an 8-bit register from an input serial command consisting of 8 bits per byte from a single digital I/O pin on a PIC16F684?

I have a slave device sending an 8 bit serial command to RA2 of a PIC16F684. The pic tests the pin 8 times for a high or low voltage. I would like to store the entire byte of data within one register address. Any thoughts?

I was thinking of making a temporary address such as Bit7, Bit6, Bit5...Bit0 and storing the temporary value of 1 or 0 and manipulating the data from there.

Any Ideas?

Thanks!
 
Test the bit & set or clear the carry bit in the STATUS register & use RLF or RRF command.Do Rotate 8 times to generate the register.
 
Check my PIC RS232 tutorials, it's really simple - you're making it sound far harder than it is.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…