Pic 16f84 + rs232 problem sending value greater than 0x79


My first post in Spanish, I have a problem sending data to a pic through 232 ...

I have it tested in physical and virtual (proteus) and in both it happens the same ...

When I try to send a value 0x80 or higher, what is sent is always a 0x3f , and I can not explain why.

When I send values between 0 and 0x79 everything is fine.

To send the data I have tested with other hyperterminales and another program in vbstudio that works well with other micros ... And they all respond the same.

Here is the code, whose function is a simple echo, and set the value received in port B.

#include <16F84.h> 
#use delay(clock=4000000)  
#use rs232(baud=9600,parity=N,xmit=PIN_A1,rcv=PIN_A0,bits=8)  
unsigned int rx; 

void main (){  

printf("%x\r\n", rx);  
Given all this gives me to think that some fuse of the pic? It's very weird, at first I thought it was to declare the variable rx as a simple int instead of a unsigned int , but it did not work either.

Can someone help me with this? Thanks in advance.

asked by static prawn 01.10.2016 в 17:23

1 answer


The code of the pic is fine, the problem is in the vb.net part, I found this and it helped me a lot.

Extended SerialPort Windows Forms Sample

link the problem is that it sent ascii instead of hex bytes

thank you all

answered by 07.10.2016 / 01:07