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>
#fuses XT,NOWDT,NOPROTECT
#use delay(clock=4000000)
#use rs232(baud=9600,parity=N,xmit=PIN_A1,rcv=PIN_A0,bits=8)
unsigned int rx;
void main (){
set_tris_b(0b00000000);
set_tris_a(0b00000001);
while(true){
rx=getc();
printf("%x\r\n", rx);
output_b(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.