PDA

View Full Version : Serin with Hyperterminal



Darrenmac
- 30th March 2004, 21:00
I have just started experementing with the pic 16f84a and I am having problems with serin.
when I use the following code only approx 16% of the time do I get the correct character outputed. the debug output works fine. I am using a max 232 and I have tried both normal and inverted modes but had even less sucess with inverted mode. I have looped back my serial and it woks ok. can someone please help?

' SERIN & SEROUT Commands
'


INCLUDE "modedefs.bas" ' Include serial modes
DEFINE OSC 4
DEFINE DEBUG_REG PORTA
DEFINE DEBUG_BIT 3
DEFINE DEBUG_BAUD 1200
DEFINE DEBUG_MODE 0

SI CON 9 ' Define serial in pin

B0 VAR BYTE

loop: SerIn SI,t1200,B0 ' B0 = input character

Debug "B0= ",B0


GoTo loop ' Forever

Darrenmac
- 3rd April 2004, 20:53
Have changed the serin to debug in and it is working fine.

Can serin be used with hyperterminal? or have I maybe missed somthing in its setup?