what about the osc speed? if different than 4MHZ, did you use the DEFINE OSC ???
what about the osc speed? if different than 4MHZ, did you use the DEFINE OSC ???
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I am suffering a similar problem here with a PIC18F2525. I know the MAX232 interface is fine, as it works perfect for bootloading. And I can get HSEROUT to work fine, but when I try to use SEROUT I get wierd characters on hyperterminal.
I am runnig at 8MHz with a ceramic resonator (yes I use DEFINE OSC 8) and using 9600 baud.
I'm wondering if it's a timing issue with software vs hardware generated serial data. I still need to try generating from other pins. Possible that the USART is still doing something to the TX pin due to the bootloader having configured it. Still troubleshooting ....
Are you using TRUE mode with SEROUT?
Going through the MAX232 you'll need to use TRUE mode. With a direct connection to the PC, you would use inverted.
In addition to Bruce, what about the config fuses? HS OSC or XT OSC???
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
For mine, I am using T9600 for SEROUT. And Hyperterm is set to 8N1.
Oscillator config fuse is set to XT (done in the bootloader firmware).
As I said, HSEROUT works perfectly. The bootloader runs smoothly at 19200, then I use the DEFINES in the PBP program to set the USART to 9600 baud.
I WILL find the problem....eventually. I haven't exhausted all of my methodical troubleshooting options yet. And I have a bit more reading up on the USART. It's possible I can just use the USART once I learn how to quickly switch between USART and using the pin as a digital I/O.
But it concerns me that I can't get the the software serial routines to put out anything but apparent garbage. And it's probably the same thing that is causing problems for Achilles.
Last edited by milestag; - 17th November 2005 at 20:19.
I'm still having a rough time getting mine to communicate correctly. I've even tried 2 different PICs (12F629 and a 16F628). Below is the code I'm using for the 629:
______________________________________
cmcon=7
define osc 4
loop:
serout GPIO.0,3,[84,97,99,111,10,13]
pause 50
low portb.1
pause 50
high portb.1
Goto loop
______________________________________
However, here is the output I get:
http://www.geocities.com/achilles03/debug.jpg
I'm running it off the internal osc. Is it possible the frequency of the internal osc varies enough to result in an unintelligible output?
I've also tried different baud rates and serout2, but with similar results (for both PICS). Can anyone see anything obvious, like some sort of conversion or program omission, that I'm doing wrong? I'd appreciate any advice.
Dave
Bookmarks