| ??? 09/05/05 09:24 Modified: 09/05/05 09:26 Read: times |
#100600 - 2 byte protocol Responding to: ???'s previous message |
This is an interesting project Jeff. Congratulations in getting this far.
I was wondering if there wasn't a bit (no pun intended) of redundancy in your serial protocol. You're currently sending 3 bytes of data, an on/off byte, an X co-ordinate, and a Y co-ordinate. How about using the LSB of each co-ordinate byte as the on/off bit - so in your first post 1 128 139 1 120 130 0 115 120 would become 1000 0001 - 129 - Laser on + X co-ord of 128 1000 0100 - 139 - Laser on (no change) + Y co-ord of 139 0111 1001 - 121 - Laser on (no change) + X co-ord of 121 1000 0010 - 131 - Laser on (no change) + Y co-ord of 131 0111 0010 - 114 - Laser off + X co-ord of 114 0111 1000 - 120 - Laser off (no change) + Y co-ord of 120 There is a slight (one unit) loss of resolution, but you save a loop through the interrupt each time to compensate. Alternatively how about sending the offset instead of the absolute co-ordinate each time (assuming that you have no wild variances. Using the same data as above, and assuming you've already reached 129, 139 by stepping there... Use bit 7 as laser on/off Use bit 6 as increment (1)/decrement (0) 1000 1000 - 88h - laser on, decrement X co-ordinate by 8 1000 1001 - 89h - laser on, decrement Y co-ordinate by 9 0000 0101 - 05h - laser off, decrement X co-ordinate by 5 0000 1010 - 0Ah - laser off, decrement Y co-ordinate by 10 I can't help feeling that you may be able to squeeze say 3 sets of data into 2 bytes of information. |
| Topic | Author | Date |
| Laser system serial port com | 01/01/70 00:00 | |
| MHz? | 01/01/70 00:00 | |
| 11.059 | 01/01/70 00:00 | |
| also... | 01/01/70 00:00 | |
| Even more... anybody got any ideas? | 01/01/70 00:00 | |
| Values in | 01/01/70 00:00 | |
| text??? | 01/01/70 00:00 | |
| thanks so far | 01/01/70 00:00 | |
| Back to basics | 01/01/70 00:00 | |
| Oh, come on... | 01/01/70 00:00 | |
| "Program" or "Code?" | 01/01/70 00:00 | |
| Oh dear... | 01/01/70 00:00 | |
| Fundamental Comms Problem | 01/01/70 00:00 | |
| Serial Code - Doomed! | 01/01/70 00:00 | |
| this is getting ridiculous | 01/01/70 00:00 | |
| learning process | 01/01/70 00:00 | |
| oh well | 01/01/70 00:00 | |
| agreed - waiting for the real stuff :-) | 01/01/70 00:00 | |
| cart before horse | 01/01/70 00:00 | |
| weekend approaching? | 01/01/70 00:00 | |
| sure we can, but then why do you say the | 01/01/70 00:00 | |
| this belong in the chat, but since it is | 01/01/70 00:00 | |
| hrm | 01/01/70 00:00 | |
| make an effort do not "whip up some code | 01/01/70 00:00 | |
| facts & emotions | 01/01/70 00:00 | |
| k | 01/01/70 00:00 | |
| Good luck with the 430's | 01/01/70 00:00 | |
| int | 01/01/70 00:00 | |
| Slight misconception. | 01/01/70 00:00 | |
| Next step | 01/01/70 00:00 | |
| -1 provocative troll | 01/01/70 00:00 | |
| read | 01/01/70 00:00 | |
| which derivative? | 01/01/70 00:00 | |
| dallas | 01/01/70 00:00 | |
| DS89C420 | 01/01/70 00:00 | |
| system im using | 01/01/70 00:00 | |
| int | 01/01/70 00:00 | |
| Process | 01/01/70 00:00 | |
| Why do you persist | 01/01/70 00:00 | |
| 2 byte protocol | 01/01/70 00:00 | |
| Intersting, but... | 01/01/70 00:00 | |
| very interesting | 01/01/70 00:00 | |
| How to proceed | 01/01/70 00:00 | |
| a problem and a suggestion | 01/01/70 00:00 | |
| Problems many & varied | 01/01/70 00:00 | |
| Begin at the beginning! | 01/01/70 00:00 | |
| started again | 01/01/70 00:00 | |
| Re: started again | 01/01/70 00:00 | |
| ah crap. | 01/01/70 00:00 | |
| ah my eyes! | 01/01/70 00:00 | |
| continued.. | 01/01/70 00:00 | |
| Second UART | 01/01/70 00:00 | |
| int vector | 01/01/70 00:00 | |
| Look at the datasheet ! | 01/01/70 00:00 | |
| yup | 01/01/70 00:00 | |
| serial port 1 interrupt vector | 01/01/70 00:00 | |
| okay | 01/01/70 00:00 | |
| Still not OK | 01/01/70 00:00 | |
| ISR reset | 01/01/70 00:00 | |
| take rest | 01/01/70 00:00 | |
| rest........ | 01/01/70 00:00 | |
| STOP | 01/01/70 00:00 | |
| just to be sure... | 01/01/70 00:00 | |
| man int triggering | 01/01/70 00:00 | |
| Craig, please remove this thread this is | 01/01/70 00:00 | |
| Request | 01/01/70 00:00 | |
| num | 01/01/70 00:00 | |
| again | 01/01/70 00:00 | |
| Thanks ALOT Jan !! | 01/01/70 00:00 | |
| works, so now do the reading | 01/01/70 00:00 | |
| serial port int | 01/01/70 00:00 | |
| transmit | 01/01/70 00:00 | |
| transmit | 01/01/70 00:00 | |
| Oh dear | 01/01/70 00:00 | |
| I dont give up. | 01/01/70 00:00 | |
| er | 01/01/70 00:00 | |
| brains? | 01/01/70 00:00 | |
| Or lack thereof... | 01/01/70 00:00 | |
| Persistance is a virtue | 01/01/70 00:00 | |
| basics | 01/01/70 00:00 | |
| updated | 01/01/70 00:00 | |
| Solve i problem at a time | 01/01/70 00:00 | |
| one more problem knocked down | 01/01/70 00:00 | |
| PWM spoiled by Rx | 01/01/70 00:00 | |
lines | 01/01/70 00:00 |



