Re: Serin,Serout Problem

Originally Posted by
orwell101
Hello!
I am a Newbie on programming Micros.
I have a PIC 16F84 an wrote a littele Program.
This is my Programm:
INCLUDE "modedefs.bas"
B0 var byte
a var byte
SI var PORTB.7
start:
SERIN si,T2400,B0
if b0 <> "0" then
for a= 0 to 255
serout si,T2400,[a]
next a
endif
goto start
end
When i send an X in the serial communicator window,the PIC sould send
the complette ASCII codes.
But the PIC send this:
X!–ˆA9Œ#‘T‘!†Ž3’H!CR‰"’*Sq‰fœ2cRbr‚’ j(PPb=RiQQfy}-RR**™-Mm*
–Xq-1=AMQ]amq}‘*˜``
!"#,-./0123<=>?@ABCLMNOPQRS\]^_`abclmnopqrs|}~€‚ƒŒŽ‘’“œžŸ *
The Settings of then Serial Communicator is:
COM1
2400 Baud
NoParity
ByteSice 8
1 Stop Bit
What do i wrong?
I think its a little Problem for the most afl here.
Sorry for mx English(german)
Thanks a lot for your help!
That you get output is good, that it is garbage can have several causes. 1 oscillator is not defined in code, 2. baud rate mismatch between sender & receiver. 3. sending and receiving mismatch (one true the other inverted). 4. long or loss-ey cables causing data corruption, or receiving noise.5.mismatched data profile I E parity # of bits . . .
I would DEFINE OSC x where x represents your crystal or resonator, or if you are using INTRC then make (x) 4. The define does not make the oscillator work at that speed it simply forces PBP to adjust all of it's timing to accommodate the defines speed.
Last edited by Archangel; - 28th October 2012 at 07:19.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks