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: 

RS232 read problem

hello,

I've got a pic witch is write configured, and writes a signal (Binairy ' 010111011') over the  RS232  port. The signal is being converted by a maxim232 ic. And i've measured it, it is +/- - 11 V  (logic 1) dc by 1.5  V dc (zero).

But now i'm trying to read (the PIC (16F870) sends continously) the signal during the basic read and write VI. The write function functions good, but the recieve function..... I've got 1 stop bit, none parity bit, and bautrate is 9600....

Now i'v got no idea why he isn't working?? (he gets a recieve time out)

Who can help me?
0 Kudos
Message 1 of 9
(3,178 Views)
Is it possible to show us the read portion of your code?
Message 2 of 9
(3,152 Views)

hi,

Are you expecting to see a terminate character, if not, switch this off.

regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 3 of 9
(3,141 Views)
The PIC sends a clear signal between + 9 and -9 Volt DC, with the cable unconnected. When i connect the cable it is the same but, only from 9 to zero or from 0 to -9 Volt DC.
 
I am using the basic serial write and read VI in labview and only trying to read (sending is working properly)...
 
I've treid many options with stop bits, but it isn't working...
 
I really don't have a clue ....
0 Kudos
Message 4 of 9
(3,117 Views)
I am using the pic 16f876 the labview code is the basic read and write vi and the assembly code is:
 
RSZEND
 bank1                ;initialize USART
 movlw  h'A2'     ;mastermode, 8bit, Async, LowSpeed
 movwf  TXSTA
 movlw  h'6'        ;9,6 kbaud @ 4mHz
 movwf  SPBRG
 bank0
 movlw  h'80'
 movwf  RCSTA
 GOTO  loopp
 
loopp
 movlw  b'10111110'
 movwf  TXREG    
 goto  loopp           ; stays in loopp
 
0 Kudos
Message 5 of 9
(3,109 Views)

just curious (maybe I missed something)..

how does it exit "loopp"?

Message 6 of 9
(3,082 Views)
it doens't..
 
so it sends the value continously, is that a problem??
0 Kudos
Message 7 of 9
(3,079 Views)

It might...

At what rate is it filling up the transmit buffer (from the PIC)? 

Does the processor/controller have time to actually send the data while the buffer is being filled?

Message 8 of 9
(3,061 Views)
The Pic sends the signal continously, i don't know of the buffer is being filled. But i think he is sending, so the buffer is empty, but  het sends at a bautrate of 9600..
 
And in this loop he uses 4 instructions is 4us.... so the buffer 9600 bits per seconde, so 1/ (9600/8) = 83,3 us per byte
 
So the buffer is (I think) full...
 
But he sends and i am measuring this with the scope.. 
0 Kudos
Message 9 of 9
(3,055 Views)