PIC lcd ds1820


Closed Thread
Results 1 to 3 of 3

Thread: PIC lcd ds1820

  1. #1
    Join Date
    May 2007
    Posts
    1

    Default PIC lcd ds1820

    Hello!
    I starting programm this device.
    I have some code, but ds not working.
    Could someone check this?

    Define CONF_WORD = 0x3f72
    Define CLOCK_FREQUENCY = 6
    AllDigital

    Define LCD_BITS = 8
    Define LCD_DREG = PORTD
    Define LCD_DBIT = 0
    Define LCD_RSREG = PORTE
    Define LCD_RSBIT = 0
    Define LCD_RWREG = PORTE
    Define LCD_RWBIT = 1
    Define LCD_EREG = PORTE
    Define LCD_EBIT = 2
    Define LCD_READ_BUSY_FLAG = 1
    Define 1WIRE_REG = PORTA
    Define 1WIRE_BIT = 1
    Lcdinit


    Dim i As Byte
    Dim j1 As Byte
    Dim j2 As Byte
    Dim por1 As Byte
    Dim por2 As Byte
    Dim text As char

    main:
    text = "Temperature:"
    PORTB = 0 ' initialize PORTB to 0
    PORTA = 255 ' initialize PORTA to 255
    TRISB = 0 ' PORTB is output
    TRISA = 255 ' PORTA is input
    lcd_init(PORTB)
    lcd_cmd(lcd_cursor_off)
    lcd_out(1, 1, text)
    do
    ow_reset(PORTA, 5) ' 1-wire reset signal
    ow_write(PORTA, 5, $cc) ' issue command to DS1820
    ow_write(PORTA, 5, $44) ' issue command to DS1820
    delay_ms(120)
    i = ow_reset(PORTA, 5)
    ow_write(PORTA, 5, $cc) ' issue command to DS1820
    ow_write(PORTA, 5, $be) ' issue command to DS1820
    delay_ms(1000)
    j1 = ow_read(PORTA, 5) ' get result
    j2 = ow_read(PORTA, 5) ' get result
    j1 = j1 > > 1 ' assuming the temp. >= 0C
    bytetostr(j1, text) ' convert j1 to text
    lcd_out(2, 8, text) ' print text
    lcd_chr(2, 10, 223) ' degree character (°)
    lcd_chr(2, 11, "C")
    delay_ms(500)
    loop until False ' endless loop
    End .

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by wchpikus View Post
    Hello!
    I starting programm this device.
    I have some code, but ds not working.
    Could someone check this?
    That's Proton Basic. This is PicBasicPro.
    Proton Basic <> PicBasicPro.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    It's not Proton, looks more OshonSoft's PICBasic to me

    http://www.oshonsoft.com/pic.html

    Sorry, i can't help much
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. LCD Display not working - PIC heating...
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 24th September 2006, 07:35
  4. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14
  5. LCD 20X4 connect with DS1820
    By jojokatada in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 9th March 2005, 11:04

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts