PDA

View Full Version : usart not workin



parinshah
- 6th April 2006, 09:06
hi frends, i m using usart module in my project. to varify that usart is working or not i wrote a simple code which is
LOOP: IF PORTC.7=0 THEN REC
GOTO LOOP
REC: PORTB=$00
PORTA=$00
PORTA=$3F
PAUSE 2000
SERIN PORTC.7,T9600,[0],B0
J1=B0
PORTB=J1
SEROUT PORTC.6,T9600,[J1]
GOTO LOOP
i m usnig teminator software wich transmits n receives data serialy,i m using pic16f876.i m nt able to receive n transmitt properly.data comes till rc7 pin bt isnt getting stored or transmitted.wht shld i do.please kindly reply i m stuck n i cnt go further,i hv my deadline to submit the project very near.
thankin in anticipation. luv,parin

Melanie
- 6th April 2006, 11:52
USART isn't working because you're not using it.

Compare the commands you have used against the PICBasic manual to discover what you have doen.

parinshah
- 6th April 2006, 12:04
USART isn't working because you're not using it.

Compare the commands you have used against the PICBasic manual to discover what you have doen.
thank u very much for ur kind concerns madam.i got ur point but this is how the serial i/o r define in manual(serin pin,mode[qualifier][item])
my syntex is
serin portc.7,t9600,[0],{bo}
wherin b0 is a variable wher byte vl b stored after the start bit(0) detected on rc7 pin.kindly reply what is the mistake.

Melanie
- 6th April 2006, 12:26
SERIN or SEROUT does not use the USART.

Apart from that, you detect Data comming in at the start of your code then WAIT TWO SECONDS before you try to grab it. It's long gone and history by the time you even get to the SERIN command.