PDA

View Full Version : Simple Serout



Perrin`
- 17th June 2008, 00:12
I'm having trouble getting Serout/HSerout to work. I'm just trying at the moment to test it and get it working because in the near future i'll need to use it in a project. Right now i've just got a PIC18F2520 hooked up to a MAX3232E line driver which goes to my PC via com1. I've tested the MAX chip and hyperterminal both of which are operating correctly and at the proper rates. The primary reason i'm using the MAX right now is because in the project I know the cable will be around 20' so I think im going to need it. The end result is:

€€€€€

in hyperterminal. (For the record I dont see that exact character, but when I copy/paste thats what is put there, I see a C with a line throught the bottom center of it.)



Include "modedefs.bas"

DEFINE OSC 4

CMCON = 7

TXPin var PORTC.6
RXPin var PORTC.7


TRISC.6 = 0
TRISC.7 = 1


'************************************************* *******
PAUSE 5000 'time to initialize


Loop:
SEROUT txpin, T9600,["P "] 'stop anything that's playing
pause 1000
goto loop

end

skimask
- 17th June 2008, 02:00
What happens at 2400 baud (or lower)?
Internal or external oscillator?
Crystal or resonator?
Up or down?

Perrin`
- 17th June 2008, 14:17
Got it, thanks.

skimask
- 17th June 2008, 14:24
Got it, thanks.
So, it works? Or what?

Perrin`
- 17th June 2008, 15:13
Ya it works -- bad oscillator