![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| hi, i am designing a circuit using pic16f877. i am controlling an instrument by a computer and using pic as the controller. Now i need to control 3 variables from the computer. And the resolution is 8 bit. i am sending the data from the computer through rs232 to the pic. i cant understand how to send 3 variables , but i know how to send 2 variables. since the pic can take a data of max 9 bit. i hope u all understood the problem. kindly give me some tips or ideas? | |
| |
| | (permalink) |
| Can't you send var1/2/3 then again var1/2/3 of the next set - so on and so forth?
__________________ "Ambition is the last refuge of failure..." --Oscar Wilde "Success is not final, failure is not fatal: it is the courage to continue that counts." -- Winston Churchill | |
| |
| | (permalink) |
| i would be sending/controlling the variables randomly. Its not sequential. its like controlling the pressure, volume and flow. hope u understood. | |
| |
| | (permalink) | |
| Quote:
There are a great many different ways you could do it, one simple one would be two split each data byte into two 4 bit nibbles, shifting the upper nibble down into the lower half of the second data byte. Then in the upper half of the nibbles add a code to signify which half of which data input it is. For example: Pressure 1000LLLL - low half of pressure Pressure 1001HHH - high half of pressure Volume 1010LLLL - low half of volume Volume 1011HHH - high half of volume And so on. This allows 8 different data bytes to be sent as double bytes of data, with each one being individually identified. Simply reassemble the bytes in the receiver software. | ||
| |