PDA

View Full Version : Hserin not working...



robert0
- 22nd August 2005, 12:25
I'm going crazy for HSERIN .......
this piece of code is fully working on portC.6 and portC.7 ( using in a pic16F876 the usart ports at 20 Mhz)
...
serout2 out,84, ["C",13]
gosub wait_char
.....
Wait_char
serin2 in,84,500,wait_timeout,[wait(">")]
return

THEN i want to use the usart hardware at same speed so:
DEFINE HSER_TXSTA 24h
DEFINE HSER_RCSTA 90h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1

and
....
hserout ["C",13]
gosub wait_char
...
wait_char:
hserin ,500,wait_timeout,[wait(">")]
return

and here the problem...Hserout is working, i can see tha data on a display ,but Hserin not at all, goin' always on wait_timeout ( where i put a led to see if program is passing over there..).
I tried to change the time of timeout, and using the same ports i'm sure that are working well because serin2 is ok, all useless.

Anyone could point me to the light ....:-)
Thanks in advance.

P.s.
i forgot to say that communication between pic and the device is at TTL level, in serin2 as well as in Usart Hserin. So at this moment NOT using a max232.