How to receive stream of bytes using PIC USART


Results 1 to 35 of 35

Threaded View

  1. #7
    Join Date
    Jun 2009
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    I am sorry for the confusion. Actually, the following code is to wait for the PC to send the request before PIC read in the data from the SpO2 module.

    Code:
    'request from PC, 9600 baud rate
    standby:
    SerIn PORTC.7,6,["P",ID_2, ID_1, ID_0]
    Once PIC get the matching ID from PC, the PIC will read the data from SpO2 module to extract the SpO2 byte and pulse rate byte from the SpO2 module. Since PC and SpO2 module are using different baud rate (which PC is 9600 baud rate and SpO2 module is 4800 baud rate), I can't put them in the suggested code line.

    The PIC need to capture 2 bytes from a stream of bytes sent by the SpO2 module. The SpO2 module sends the bytes in sequence and continuously. I get the wrong data but I think there is nothing wrong with my algorithm to capture the intended data, by referring to the manual of the SpO2 module.

    My guess is that the PIC's receiver buffer has overflowed and causing the data clash. How should I avoid the buffer overflow so that I could retrieve the correct data byte from the byte stream of the SpO2 module?
    Last edited by unifoxz; - 14th June 2009 at 01:28.

Similar Threads

  1. Replies: 6
    Last Post: - 31st August 2007, 10:31
  2. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 09:12
  3. 16F876 Usart Receive
    By syscoder in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 21st March 2007, 16:43
  4. Replies: 1
    Last Post: - 6th September 2005, 17:32
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th March 2005, 00:14

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts