can you post your code?
can you post your code?
Here is the PIC code. I am sending the data as a string from a TextBox in Visual Basic. By the way, the "END" is returned as "ÅND" if this gives any further clues!
@ DEVICE HS_OSC,LVP_OFF,WDT_OFF,PROTECT_OFF,BOD_OFF,PWRT_OF F
'declare variables
define OSC 20
DEFINE HSER_BAUD 19200 'serial
DEFINE HSER_RCSTA 90h 'serial
DEFINE HSER_TXSTA 24h 'serial
DEFINE HSER_CLROERR 1 ' automatic clear overrun error
DEFINE HSER_EVEN 1
DEFINE HSER_BITS 7
trisb = %11000000 ' set port b 0-5 o/ps 6&7 i/ps
RCIF VAR PIR1.5
SERIALDATA VAR BYTE
portb.0 = 0
portb.1 = 0
portb.2 = 0
portb.3 = 0
PAUSE 100
MAIN:
portb.0 = 0
IF RCIF THEN
pause 100
sound portb.0,[60,10]
HSERIN [SERIALDATA] 'RCIF is reset by reading HSERIN
HSEROUT [SERIALDATA,"E","N","D"]
ENDIF
GOTO MAIN
end
Have you test the code with a simple program like terminal and give the numbers by hand and slowly ?
What about you VB code?
Ioannis
Your Crystal, Trimming Capacitors or a hundred other things could be affecting the Oscillator frequency. Looks like it's slightly off for your fast baud rate.
Drop your communications down to 2400 and work up from there. You'll discover there will be a point where unacceptable errors start creeping in.
See what this does:
It should display Decimal digits, no modifyer should display ASCII, and HEX . . .Have not tried it, modifyer might make a mess out of the string "END"Code:HSEROUT[IDEC,SERIALDATA,"END"10,13]
Actually there should be a comma after END... - Melanie
Code:HSEROUT[IDEC,SERIALDATA,"END",10,13]
Last edited by Archangel; - 29th April 2009 at 11:26.
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.
Thanks for the quick replies.
After trying the PBP Serial Comm I realised I had not configured the Port correctly in VB ie Was 19200,N,8,1 should be 19200,E,7,1 as in the PBP code config.
Simple mistake made by a now wiser person!
Bookmarks