PDA

View Full Version : LCD 20X4 connect with DS1820



jojokatada
- 6th February 2005, 17:46
'display message on the 4 X 20 character LCD using pic16f84a and DS1820

DEFINE LCD_DREG PORTA 'LCD data port
DEFINE LCD_DBIT 0 'LCD data starting bit 0 or 4
DEFINE LCD_RSREG PORTA 'LCD register select port
DEFINE LCD_RSBIT 4 'LCD register select bit
DEFINE LCD_EREG PORTB 'LCD enable port
DEFINE LCD_EBIT 3 'LCD enable bit
DEFINE LCD_BITS 4 'LCD bus size 4 or 8
DEFINE LCD_LINES 4 'Number lines on LCD
DEFINE LCD_COMMANDUS 2000 'Command delay time in us
DEFINE LCD_DATAUS 50 'Data delay time

symbol DQ = PORTB.4
temp var word
cou var byte
cou1 var byte
pause 100
main:
owout DQ, 1,[$CC, $44]
owin DQ, 4,[cou]
if cou = 0 then
owout DQ, 1, [$cc, $BE]
owin DQ, 0,[temp.lowbyte, temp.highbyte, skip 4, cou,cou1]
endif

temp = (((temp >> 1) * 100) - 25 ) + (((cou -cou1) * 100) / cou)
lcdout $fe, 1, dec (temp / 100), " . " , dec2 temp, " C"
pause 1000
goto main
end


end

Please help take alook at my attchment i got many error which i could not solved

mister_e
- 6th February 2005, 18:57
hummm no error here when compiling your code. Looks like your PBP .INC, .BAS files are corrupted...

Reinstall your PBP and MPLAB an tell us what's happening.

jojokatada
- 6th February 2005, 19:32
i am using microcode studio suite a free software and picbasic pro 2.3 i only unzipped the pbp to drive c of my pc

mister_e
- 6th February 2005, 19:40
Reason is simple now. Version 2.3 don't support OWIN and OWOUT.. must buy an upgrade disk.

http://www.melabs.com/support/upgrade.htm#pbp

jojokatada
- 6th February 2005, 19:48
ok thank you for the advice

jojokatada
- 8th February 2005, 02:09
hi
is it possible to use 4 ds1820 a pic16f84a which will be display four different temperature on the 4 lines of the lcd?

with my single ds1820 how can i edit to make it work for 4 ds1820

any help will be highly appreciated.

Ceug2005
- 9th March 2005, 11:04
$55 - match ROM
$10,$BB,$40,$2C,$00,$08,$00,$F9 - 64 bit rom code for sensor 1
$44 - do temp conversion

sensor 1:
OWOUT PortB.0, 1, [$55,$10,$BB,$40,$2C,$00,$08,$00,$F9,$44]
' match ROM &
pause 1000 ' conversion time 750 ms
OWOUT PortB.0, 1, [$55,$10,$BB,$40,$2C,$00,$08,$00,$F9,$BE]
' match ROM & read scratchpad memory

OWIN PortB.0, 2, [R_Temp0.Lowbyte, R_Temp0.Highbyte,skip4,count_remain_0,count_per_c_ 0]

same for sensor 2,3,4 --- if you heave enough space in PIC16F84