How do i get rid of the the framing error

Hello,
I am a student working on a Pulse Oximeter and i am supposed to send sample values to Labview via the RS232 serial configuration. I am able to view the data in VISA but i am unable get the graph running constantly. There is always a framing error(-1073807253) whenever i run the VI and the graph only appears for a few seconds before the whole VI halts to display the error. How do i get rid of the error. I am only sending 8 bits of data. I have even tried using even the most simplest program whereby i send only characters A & C and even then i am getting the framing error. Please help me, i am in need of urgent and desperate help. I am sending these cahracters from the PIC16F877 using assembly language and i have attached the code to this forum thread. I have even tried making use of 9 bit transmission and parity bits and nothing seems to work for me. Please provide me with some help and suggestions. Have a look at my program and VI and sugggest some solutions as soon as possible. Your help will be greatly appreciated.
Thank You
Best regards,
Samarth Pawar
Temasek Polytechnic
Singapore
Below is my program to send the data:
#include
TXSTA_INIT EQU 0x24
TRISC_INIT EQU 0x80
RCSTA_INIT EQU 0x90
#define Freq .4000000
#define Baud(X) (Freq/(.16*X))- .1
call SetupSerial
Loop:
movlw 'A'
movwf TXREG
call Usart_Send
movlw 'C'
movwf TXREG
call Usart_Send
bcf TXSTA,TXEN
goto Loop
;;;;;;;;;;;;1MS DELAY;;;;;;;;;;;
DLY1MS MOVLW D'40'
MOVWF H'31'
LOOP2 CALL DLY
DECFSZ H'31'
GOTO LOOP2
RETURN
DLY MOVLW D'1'
MOVWF H'30'
NOP
LOOP1 DECFSZ H'30'
GOTO LOOP1
NOP
RETURN
SetupSerial:
Banksel TRISC
movlw TRISC_INIT
movwf TRISC
movlw Baud(.9600)
movwf SPBRG
movlw TXSTA_INIT
movwf TXSTA
Banksel RCSTA
movlw RCSTA_INIT
movwf RCSTA
Return
Usart_Send:
banksel TXSTA
SS_Wait btfss TXSTA,TRMT
goto SS_Wait
bcf STATUS,RP0
CALL DLY1MS
Return
END ; directive 'end of program'
Attachments:
New_ash.vi ‏180 KB

Four things to check when having problems with serial com:
1. Make sure the baud rate matches the device.
2. Make sure the parity bit matches the device.
3. Make sure the number of stop bits matches the device.
4. Look for buffer overruns if you do not use flow control.
Like CC said, using Hyperterminal will verify that you are getting good responses from your device. If it runs fine for a while, then you start getting errors, the most likely cause is buffer overruns. You will have to use flow control to prevent this from happening. You will have to know what type of flow control your device supports, hardware flow control (RTS-CTS), or software flow control (XON-XOFF).
CC: Look again, he did post his vi.
- tbob
Inventor of the WORM Global

Similar Messages

Maybe you are looking for

  • Why does firefox download as a device to be saved to?

    When I download Firefox 26 it acts as a device to be saved to on the Macbook Air.  Also every time I open Firefox a window opens but and warns of something but I cannot recall that uness I close everything down again, and I would have to redo this em

  • Published fla file appears small on website

    Hi, I published a flash movie clip into html (using flash pro 8) and uploaded it to the internet. When I opened the URL in IE version 8 the flash movie clip displayed exactly the way it looked in flash (Centre of the screen and 700Width x 400 Height)

  • Why does the battery need to be recharged so often?

    My iPod is brand new and need recharging every other day. Why and how does this happen?

  • Jakarta POI and Java Excel API

    I recently downloaded both these as I'm trying to create an application that reads information from an excel file. However, the problem I am having is that I just don't know where to start. When I download the files and unzip them, I haven't a clue w

  • Little help for a novice - Need a ps script to list user with their email only.

    Hi, I need to extract every month the user list which have their email information on it, so i don't need to extract the user services etc from the AD. Today, i'm using this script i made : clear-host Import-Module activedirectory $CurrentDate = Get-