Trying to get LCD to work on 18f45k22 and portB and EasyPic V7 - no luck


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Trying to get LCD to work on 18f45k22 and portB and EasyPic V7 - no luck

    your config is incorrect for those settings



    Code:
    ASM
      __config  _CONFIG1H, _FOSC_HSHP_1H & _PLLCFG_ON_1H & _PRICLKEN_OFF_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
      __config  _CONFIG2L, _PWRTEN_OFF_2L & _BOREN_SBORDIS_2L & _BORV_190_2L
      __config  _CONFIG2H, _WDTEN_ON_2H & _WDTPS_32768_2H
      __config  _CONFIG3H, _CCP2MX_PORTC1_3H & _PBADEN_OFF_3H & _CCP3MX_PORTB5_3H & _HFOFST_ON_3H & _T3CMX_PORTC0_3H & _P2BMX_PORTD2_3H & _MCLRE_EXTMCLR_3H
      __config  _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L & _DEBUG_OFF_4L
      __config  _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L
      __config  _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
      __config  _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L
      __config  _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
      __config  _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L
      __config  _CONFIG7H, _EBTRB_OFF_7H
    ENDASM
    and you need a


    define OSC 32

    statement in your code

    why use a xtal ? why run at 8MHz ?
    when the chip has a int osc that can do 64mhz
    Warning I'm not a teacher

  2. #2
    Join Date
    Oct 2008
    Posts
    52


    Did you find this post helpful? Yes | No

    Default Re: Trying to get LCD to work on 18f45k22 and portB and EasyPic V7 - no luck

    Well that worked fine.....
    Well the board has a crystal hook up but can be strapped in and out.
    I did try just the define osc 32 with my config and it also worked...
    as you probably surmised, I am pretty much a newbie..so why the ocs 32 define and say not 16 or 8?

    By the way thanks a bunch
    Last edited by dbachman; - 18th November 2017 at 23:56.

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Trying to get LCD to work on 18f45k22 and portB and EasyPic V7 - no luck

    define OSC 32
    tells the compiler to perform all timing calculations for a clock speed of 32 MHz
    it defaults to 4 MHz if omitted , it should match the real clock speed used
    using 8 or 16 is simply wrong


    _PLLCFG_ON with a 8mhz xtal yields a 32 MHz clock

    no point guessing read the manual, read the data sheet
    Warning I'm not a teacher

  4. #4
    Join Date
    Oct 2008
    Posts
    52


    Did you find this post helpful? Yes | No

    Default Re: Trying to get LCD to work on 18f45k22 and portB and EasyPic V7 - no luck

    Soif I was using an internal oscillator, I would define it in Config1h and further in OSCCON?

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Trying to get LCD to work on 18f45k22 and portB and EasyPic V7 - no luck

    using an internal oscillator, I would define it in Config1h and further in OSCCON?
    yes

    not forgetting if and when the pll is engaged
    and setting define OSC appropriately

    there is a tool called meconfig , look it up and download a copy , it makes life easier.
    pity is that melabs don't update things much anymore so newer chips are missing , its still useful though
    Warning I'm not a teacher

  6. #6
    Join Date
    Oct 2008
    Posts
    52


    Did you find this post helpful? Yes | No

    Default Re: Trying to get LCD to work on 18f45k22 and portB and EasyPic V7 - no luck

    Ok Richard Thank you but it looks like meconfig is not anywhere.. at least I couldn't find it to download..I will keep looking but ME labs has a posting that is discontinued and end of life....

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Trying to get LCD to work on 18f45k22 and portB and EasyPic V7 - no luck

    I couldn't find it to download.
    me either, thats a shame . i better not have another pc crash or that may be the end of it


    welcome to the Death Spiral of legacy software

    seems the spiral is tightening
    Warning I'm not a teacher

Similar Threads

  1. Replies: 3
    Last Post: - 6th November 2011, 19:33
  2. Replies: 36
    Last Post: - 14th March 2011, 18:38
  3. Replies: 6
    Last Post: - 12th March 2011, 13:11
  4. LCD Data on portA and portB
    By EDWARD in forum mel PIC BASIC
    Replies: 31
    Last Post: - 22nd July 2005, 14:27
  5. Lcd On Porta And Portb
    By EDWARD in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 5th May 2005, 05:53

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