Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/30/06 12:35
Modified:
  01/30/06 12:36

Read: times


 
#108701 - data consistency
Responding to: ???'s previous message
A word of caution, unless your timers are not stopped while trnasmitting, you might run into the risk of sending an unconsistent state. A trivial example, counter1=10FFh, you transmit the high byte as 10h, while it gets transmitted it increments into 1100h, you transmit the low byte as 00h, the master gets the impression that the current state of your timer is 1000h (which is far from both 10FFh and 1100h).

An another remark, I did this type of "buffer sparing" but from a different reason - the protocol I was writing for (not Modbus) required this sort of "counters" (which I had to copy into a buffer to produce such consistent "snapshot") plus static data plus constants (of which most were zeros (=unimplemnted counters :-) )) - I spared RAM by using a list of "pointers" stored in code memory, "pointing" both into code and data memory; and the transmitting interrupt routine transmitted the "pointed" data. CRCs were calculated on the fly, of course, by the transmitting isr - this is why it's much more convenient to have checksums at the end of packets in packetized protocols.

Jan Waclawek


List of 12 messages in thread
TopicAuthorDate
Sending a large array out a serial port            01/01/70 00:00      
   Solved as per above            01/01/70 00:00      
   state it more clearly            01/01/70 00:00      
      More Clearly Defined Question            01/01/70 00:00      
   State Machine            01/01/70 00:00      
      State Machine            01/01/70 00:00      
         data consistency            01/01/70 00:00      
            ISR Calculating the CRC            01/01/70 00:00      
   A possibly irelevant thought...            01/01/70 00:00      
      Protocol Intercharacter Timeout            01/01/70 00:00      
   a simplification            01/01/70 00:00      
      Buffer size            01/01/70 00:00      

Back to Subject List