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

Back to Subject List

Thread Closed: Issue successfully resolved

???
02/06/04 23:50
Read: times


 
#64138 - Circular buffers
Hello,

As part of a bigger program I have been struggling with serial RX and TX circular buffers.
Both buffers are 100 bytes wide.
I keep track of 4 pointers for the read/write positions in both buffers and two counters which keep track of the number of bytes waiting.(difference between read/write pointers)

the only thing I want to do is to echo-en bytes send from a PC back to this PC. Later there will be some processing on the received data and then transmitted.

To achieve this I'm copying the receive buffer to the transmit buffer while taking care of the pointers. This event is triggered when a byte is received.
This works with single characters but when I send 1 or more lines (text file 10 characters from Hyperterminal) the software freezes. What I notice is that all pointers but the TX_read_pointer display the correct value.

I've studied a lot of examples (mostly in C and assembler but I can't read them well).I don't know a lot of C. Pretty frustrating because in the code library on the left is a Keil example of using these buffers I use Bascom 8051 to write my source.
I'll post my code if someone wants to see it

I can't see what I'm doing wrong..... Can anyone help me or has an example program of what I want to do? Perhaps a flowchart?

Thanks in advance and with best regards,

Peter Huijssen


List of 35 messages in thread
TopicAuthorDate
Circular buffers            01/01/70 00:00      
   RE: Circular buffers            01/01/70 00:00      
   RE: Circular buffers            01/01/70 00:00      
   RE: Circular buffers            01/01/70 00:00      
      RE: Circular buffers            01/01/70 00:00      
   RE: Circular buffers            01/01/70 00:00      
      RE: Circular buffers            01/01/70 00:00      
      RE: Circular buffers            01/01/70 00:00      
         RE: Circular buffers            01/01/70 00:00      
         RE: Circular buffers            01/01/70 00:00      
            RE: Circular buffers            01/01/70 00:00      
               RE: Circular buffers            01/01/70 00:00      
                  RE: Circular buffers            01/01/70 00:00      
                     RE: Circular buffers            01/01/70 00:00      
                        RE: Circular buffers            01/01/70 00:00      
                           RE: Circular buffers            01/01/70 00:00      
                              RE: Circular buffers            01/01/70 00:00      
                                 RE: Circular buffers            01/01/70 00:00      
                                    RE: Circular buffers            01/01/70 00:00      
               RE: Circular buffers            01/01/70 00:00      
                  RE: Circular buffers            01/01/70 00:00      
                     RE: Circular buffers            01/01/70 00:00      
                        RE: Circular buffers            01/01/70 00:00      
                           RE: Circular buffers            01/01/70 00:00      
                           RE: Circular buffers            01/01/70 00:00      
                              RE: Circular buffers            01/01/70 00:00      
      RE: Circular buffers            01/01/70 00:00      
         RE: Circular buffers            01/01/70 00:00      
            RE: Circular buffers            01/01/70 00:00      
   RE: Circular buffers            01/01/70 00:00      
      RE: Circular buffers            01/01/70 00:00      
      RE: Circular buffers            01/01/70 00:00      
         RE: Circular buffers            01/01/70 00:00      
            RE: Circular buffers            01/01/70 00:00      
               RE: Circular buffers            01/01/70 00:00      

Back to Subject List