Hi,
Have you tried changing mode for DEBUG, true vs inverted?/Henrik.Code:DEFINE DEBUG_MODE 0 'or 1 (I can't remember which one at the moment)
Hi,
Have you tried changing mode for DEBUG, true vs inverted?/Henrik.Code:DEFINE DEBUG_MODE 0 'or 1 (I can't remember which one at the moment)
A couple of other things to check are the charge pump capacitors that you are using with your RS-232 chip and your circuit grounds.
Based on your description, the data is either inverted, or being sent at the wrong speed. Verify setting match in both your code and on the PC, (for example 9600,8,N,1) and then check your clock on the PIC is correct. The speeds specified in PBP are only valid with a certain clock (4 MHz off the top of my head). You should not need to set DTR, or DCD. Final thing to check is that the RS232 cable is connected properly. If you have not crossed TX to RX, sometimes noise with give screens of garbage.
Also, make certain that Hyperterm is set for Flow Control = None
Charles Linquist
Are you adding the '#' before the variable?
And if you are using the built-in oscillator on the 16F676, are you sure your OSCCAL value is correct?
Regards,
Anand
Firs one thanks to all for fast answer.
Yes I have checked all things posted and a lot of times.
But nothing work.
Maybe is a problem with a Breadboard thet collect noise ?
I know it hard to say what check, but all seem fine and at
same time nothing work!
I am very confused because I have made a lot o circuit
with PIC in assembler and basic, with motor, with display,
with PWN dimmed ligght, and ever have worked fine,
but now with a silly serial debugging purpose nothing
work.
I am very frustated!
Last edited by synsyn; - 30th September 2011 at 21:01.
Post you code and configs along with a schematic.
Everyone is guessing as is.
Dave
Always wear safety glasses while programming.
Hello,
Thank for reply and sorry for the late to answer but I was away for job.
I don't have much to to make experiment but I have try to change the
cable and the main circuit.
All is same I will get back the same garbage but...
Now i try to send the word "Hello" and now I get back on screen PC the
exact number of chars but with non ascii format like '¨µ¼´¿".
Yesterday I don't know how, maybe some change to prog or same hack
on circuit, for a short time I have get back the correct string on screen!
"hello"hello"hello"...
After that I have made some change and now all is come back in the
same garbage!
In anyway this is the source:
------------------------------------------------------------------------------
ANSEL=0
CMCON=7
TRISA = %11110000 ' Set PORTA to all input
TRISC = %00000000 ' Set PORTA to all input
Include "modedefs.bas"
DEFINE OSC 4
DEFINE DEBUG_REG PORTC
DEFINE DEBUG_BIT 1
DEFINE DEBUG_BAUD 2400
DEFINE DEBUG_MODE 0
DEFINE DEBUG_PACING 1000
Clear
Pause 1000
Cont var Byte
Cont = 0
Mainloop
PAUSE 1000
Cont = Cont + 1
Debug "Hello"
PORTC.2 = 1
PAUSE 1000
PORTC.2 = 0
goto Mainloop
------------------------------------------------------------------------------
And this the circuit:
![]()
Bookmarks