From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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'
0 Kudos
Message 1 of 3
(2,713 Views)
First, check the transmission using a simple communication program such as Hyperterminal, just to verify that your serial com is working properly.
Then, post your vi, we'll find a way to help you.

CC
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 2 of 3
(2,708 Views)
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
0 Kudos
Message 3 of 3
(2,700 Views)