RS232 and values of 255
Posted: Sun Jun 24, 2007 11:44 pm
Hi,
I am working on some RS232 code and I have found that I need to be able to send/receive values that exceed a BYTE value of 255.
For example, I will send the computer 1900.
1) How do you "break" apart 1900 into into 2 BYTES to send it to the PC.
The computer will send 1900 to PIC.
2) How do I assemble the 2 BYTEs received from the computer so it becomes 1900.
3) I also need to be able to store the received 2 BYTEs as BYTES in EEPROM of the PIC then read out the 2 BYTES and assemble then back to INT. My guess this is the same #2 but want to be sure.
It has been my experience that there is often many ways to do anything when it comes to programming. I am looking for a way using the standard Flowcode blocks, if possible.
Thanks,
Ron
I am working on some RS232 code and I have found that I need to be able to send/receive values that exceed a BYTE value of 255.
For example, I will send the computer 1900.
1) How do you "break" apart 1900 into into 2 BYTES to send it to the PC.
The computer will send 1900 to PIC.
2) How do I assemble the 2 BYTEs received from the computer so it becomes 1900.
3) I also need to be able to store the received 2 BYTEs as BYTES in EEPROM of the PIC then read out the 2 BYTES and assemble then back to INT. My guess this is the same #2 but want to be sure.
It has been my experience that there is often many ways to do anything when it comes to programming. I am looking for a way using the standard Flowcode blocks, if possible.
Thanks,
Ron