The display never showed the 444 or 888.
I posted a new picture.
I tried removing the pauses, putting them at half the pause you had them, also changed the trailer byte to $55 ..same effect.
The display never showed the 444 or 888.
I posted a new picture.
I tried removing the pauses, putting them at half the pause you had them, also changed the trailer byte to $55 ..same effect.
Last edited by lerameur; - 26th December 2006 at 21:44.
Ok, let's try the silly simple and build back up... I guess we gotta figure out where this whole thing is failing at. If this don't work......I dunno....
'RECEIVE PIC
INCLUDE "modedefs.bas"
DEFINE OSC 20 'use external 20mhz crystal
CMCON = 7 : ANSEL = 0 : ADCON1 = 7
DEFINE LCD_DREG PORTA ' Set LCD Data port
DEFINE LCD_DBIT 0 ' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit
DEFINE LCD_EREG PORTB ' Set LCD Enable port
DEFINE LCD_EBIT 0 ' Set LCD Enable bit
DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 2 ' Set number of lines on LCD
DEFINE LCD_COMMANDUS 2500
DEFINE LCD_DATAUS 250
temp var word : temp1 var word : input portb.2
loop:
serin portb.2 , t2400 , [ temp ]
lcdout $fe , $80 , DEC3 temp
temp1 = temp1 + 1
lcdout $fe , $c0 , DEC5 temp1
goto loop
End
'TRANSMIT PIC
INCLUDE "modedefs.bas"
DEFINE OSC 20 'use external 20mhz crystal
CMCON = 7 : ANSEL = 0 : ADCON1 = 7
DEFINE LCD_DREG PORTA ' Set LCD Data port
DEFINE LCD_DBIT 0 ' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit
DEFINE LCD_EREG PORTB ' Set LCD Enable port
DEFINE LCD_EBIT 0 ' Set LCD Enable bit
DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 2 ' Set number of lines on LCD
DEFINE LCD_COMMANDUS 2500
DEFINE LCD_DATAUS 250
DEFINE CHAR_PACING 33333
temp var byte : temp1 var word : output portb.2
loop:
temp = temp + 1
serout portb.2 , t2400 , [ temp ]
lcdout $fe , $80 , DEC3 temp
temp1 = temp1 + 1
lcdout $fe , $c0 , DEC5 temp1
goto loop
ok, the sending pic increment both on line 1 and two
the receiving end displays a constant 535 on the 1st line and 49102 on the second line
problem still persist
Last edited by lerameur; - 26th December 2006 at 23:23.
ok here it is :
THIS DO NOT WORK;
loop:
serin portb.2 , n2400 , [ temp]
lcdout $fe , $80 , DEC temp
pause 200
goto loop
End
THIS WORKS;;
loop:
serin portb.2 , n2400 , temp
lcdout $fe , $80 , DEC temp
pause 200
goto loop
End
AS soon as I put the square brackt , the display is messed up
You are abso-freekin-lutely right!!!!!!!!!! My fonts have been messed up this whole time on my pdf viewer!!!!!!!! In the PBP manual, it shows what looks like brackets around the 'item', when there really isn't any brackets!!!!!!! AND...when I looked at the project I was saying that worked just fine, it doesn't have brackets either!!!!!!! Freekin''''amazing....I should've caught this days ago!!!!!
Let's go back, but not as far...
Working on another post/program that should work 100% all the way this time.
(damn, I could seriously kick my own ass right now)....
I'll have it posted here in a few minutes...
SERIN doesn't use brackets!!!!!!
SEROUT DOES use brackets!!!!!!
(My installation of Acrobat reader's fonts got screwed up at my end sometime in the past, that's what been messing it up. With the brackets in place, serin has been waiting for qualifiers this whole time, not actual data!)
'RECEIVE PIC
INCLUDE "modedefs.bas"
DEFINE OSC 20 'use external 20mhz crystal
CMCON = 7 : ANSEL = 0 : ADCON1 = 7
DEFINE LCD_DREG PORTA ' Set LCD Data port
DEFINE LCD_DBIT 0 ' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit
DEFINE LCD_EREG PORTB ' Set LCD Enable port
DEFINE LCD_EBIT 0 ' Set LCD Enable bit
DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 2 ' Set number of lines on LCD
DEFINE LCD_COMMANDUS 2500
DEFINE LCD_DATAUS 250
temp var word : tempf var word
leader var byte : trailer var byte : count var byte
temp1 var byte : temp2 var byte : temp3 var byte : temp4 var byte
input portb.2 : pause 1000
loop:
lcdout $fe , $c0 , "Waiting......" , DEC3 count
temp = 0 : tempf = 0
leader = 0 : trailer = 0 : count = 0
temp1 = 0 : temp2 = 0 : temp3 = 0 : temp4 = 0
serin portb.2 , t2400 , leader 'get leader byte
serin portb.2 , t2400 , temp1
serin portb.2 , t2400 , temp2
serin portb.2 , t2400 , temp3
serin portb.2 , t2400 , temp4
serin portb.2 , t2400 , count
serin portb.2 , t2400 , trailer
if ( leader + trailer ) <> $ff then 'if leader + trailer doesn't add up right...
lcdout $fe , $c0 , "Out of Sync..", DEC3 count : goto loop
endif
temp.highbyte = temp1
temp.lowbyte = temp2
tempf.highbyte = temp3
tempf.lowbyte = temp4
lcdout $fe , $c0 , "Received....." , DEC3 count
lcdout $fe , $80 , "Tc=" , DEC3 temp , "C,Tf=" , DEC3 tempf , "F."
goto loop
End
'TRANSMIT PIC
INCLUDE "modedefs.bas"
DEFINE OSC 20 'use external 20mhz crystal
CMCON = 7 : ANSEL = 0 : ADCON1 = 7
DEFINE LCD_DREG PORTA ' Set LCD Data port
DEFINE LCD_DBIT 0 ' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit
DEFINE LCD_EREG PORTB ' Set LCD Enable port
DEFINE LCD_EBIT 0 ' Set LCD Enable bit
DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 2 ' Set number of lines on LCD
DEFINE LCD_COMMANDUS 2500
DEFINE LCD_DATAUS 250
DEFINE CHAR_PACING 33333
count var byte
output portb.2 : high portb.2 : input portb.3 : dq var portb.4
temp var word : tempf var word
temp1 var byte : temp2 var byte : temp3 var byte : temp4 var byte
pause 1500
loop:
lcdout $fe , $c0 , "Getting......" , DEC3 count
owout DQ , 1 , [ $cc ]
owout DQ , 0 , [ $44 ]
Pause 500
owout DQ , 1 , [ $cc ]
owout DQ , 0 , [ $be ]
owin DQ , 0 , [ temp.LOWBYTE , temp.HIGHBYTE , skip 6 ]
tempf = temp * 9 : tempf = tempf / 5 : tempf = tempf + 32
lcdout $fe , $c0 , "Display......" , DEC3 count
lcdout $fe , $80 , "Tc=" , DEC3 temp , "C,Tf=" , DEC3 tempf , "F."
lcdout $fe , $c0 , "Sending......" , DEC3 count
serout portb.2, t2400 , [ $aa ] 'send a leader byte
temp1 = temp.highbyte : temp2 = temp.lowbyte
serout portb.2 , t2400 , [ temp1 ]
serout portb.2 , t2400 , [ temp2 ] 'send data
temp3 = tempf.highbyte : temp4 = tempf.lowbyte
serout portb.2 , t2400 , [ temp3 ]
serout portb.2 , t2400 , [ temp4 ] 'send data
serout portb.2 , t2400 , [ count ] 'send count
serout portb.2 , t2400 , [ $ff ] 'send a trailer byte
lcdout $fe , $c0 , "Sent....." , DEC3 try1 , "," , DEC3 try2
count = count + 1
goto loop
And that should do it!!!
in the transmit code you have this line:
lcdout $fe , $c0 , "Sent....." , DEC3 try1 , "," , DEC3 try2
what is try1 and try2 from ???
I just tried it,
even with that line out, it still dont show me the temperature on the receiving end
I think the word count is a reserved word.
changed to counter
The receiver is just showing waiting... and the counter
Last edited by lerameur; - 27th December 2006 at 12:16.
Bookmarks