1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Oshonsoft LCD Setup

Discussion in 'Oshonsoft' started by aljamri, Jun 17, 2011.

  1. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,180
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    This is the Oshonsoft Forum..:)
    What did you use to run that image of the LCD that you posted.?
     
    Last edited: Jun 18, 2011
  2. aljamri

    aljamri Member

    Joined:
    Jun 12, 2006
    Messages:
    694
    Likes:
    6
    I've loaded the Hex. file into the program and set the LCD as per your suggestions and press F1 to run and get the image.

    I've got the attached Hex. file but don't know is it what you ask or not.
     

    Attached Files:

    • 123.hex
      File size:
      2.9 KB
      Views:
      92
  3. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,180
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    OK, I will use that hex file for a OSH test.:)

    Do you know how to use Oshonsoft Basic.?
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,180
    Likes:
    644
    Location:
    Ex Yorks' Hants UK

    hi aljamri,
    I see whats happening in Oshonsoft.

    When running in simulation, the program is much slower, so any program delays take a very long time.

    The program may appear to have stopped but its running in the delays loops, very slowly.

    Can you write in Oshonsoft Basic.???

    EDIT:
    If you are using the code you posted, for a test delete the delay 2000ms
     
    Last edited: Jun 18, 2011
  6. aljamri

    aljamri Member

    Joined:
    Jun 12, 2006
    Messages:
    694
    Likes:
    6
    No, I'm loading Oshonsoft with Hex. files compiled either from MikroC or MPASM, but dont know that it has its own compiler or not!

    I'm aware about this, for that I'm decreasing the clock Freq. into 1MHz and increasing the rate upto Extremly fast or Ultimate.

    As usual You are right, when I deleted it, the program works fine and updating, but is this going to work in real circuit as well as on OshonSoft ?
     
    Last edited: Jun 18, 2011
  7. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,180
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    Decreasing the Sim clock rate to 1MHz will make it 4 times SLOWER!

    Leave out the long delay while you are using the OSH simulator, put it back in when getting ready to program a PIC.

    Can you tell me exactly what you are trying to do.?

    You have a mixture of 'C' , ASM and some Basic ie; 'Save Settings'
     
    Last edited: Jun 18, 2011
  8. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,180
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    Using OSH basic this is all you need to show the adc on the LCD.
    [CODE
    Define CONF_WORD = 0x3f31

    Define SIMULATION_WAITMS_VALUE = 1

    AllDigital

    Define LCD_LINES = 2
    Define LCD_CHARS = 16
    Define LCD_BITS = 4
    Define LCD_DREG = PORTB
    Define LCD_DBIT = 0
    Define LCD_RSREG = PORTB
    Define LCD_RSBIT = 4
    Define LCD_EREG = PORTB
    Define LCD_EBIT = 7
    Define LCD_RWREG = PORTB
    Define LCD_RWBIT = 6
    Define LCD_READ_BUSY_FLAG = 1

    Dim num As Word

    ADCON0 = 0b11000000
    ADCON1 = 0b10001111
    TRISA = 0xff
    TRISB = 0

    Lcdinit

    loop:
    Lcdcmdout LcdLine1Home
    Adcin 0, num

    Lcdout #num, " "

    Goto loop[/CODE]
     

    Attached Files:

  9. aljamri

    aljamri Member

    Joined:
    Jun 12, 2006
    Messages:
    694
    Likes:
    6
    I put the clock speed back to 20MHz and got faster simulation :).

    I'm trying to measure 1 to 5 volts as what I told you in http://www.electro-tech-online.com/threads/reading-4-20-ma-on-lcd-using-pic16f876a.119563/ ", and since I found Oshonsoft much easier than programming and testing real chip, I start testing here.

    I dont know, as I told you, I used the hex file generated from Mikroc or MPASM and running the oshonsoft, as simple as this.
     

Share This Page