18F4523 beginner needing help to blink an LED...


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Feb 2011
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Re: 18F4523 beginner needing help to blink an LED...

    I looked into ALL DIGITAL and thought it would be the answer to all my prayers...

    My Code is now as follows:

    INCLUDE "ALLDIGITAL.pbp"
    define SHOWDIGITAL 1
    Main:
    TOGGLE PORTE.0
    PAUSE 1000
    GOTO Main


    Unfortunately I still cannot get any outputs.

    When compiled I get the following messages in the results window:
    ADCON1 = 0x0F
    CMCON = 7

    I have rechecked my software and hardware by programming another Pic, a 16F690, and this programs fine.

    I am beginnig to think I may have a dodgy couple of IC's. I'll try and build another board up next Monday to rule out this, although I can program and read the pic with the setup I have now.

    Any other things I can try?

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: 18F4523 beginner needing help to blink an LED...

    I do not have this chip but give this a shot
    Code:
    '18F4523 INTERNAL OSC 8MHZ Internal oscillator block, port function on RA6 and RA7	
    @ __CONFIG    _CONFIG1H, _OSC_INTIO67_1H  & _FCMEN_OFF_1H & _IESO_OFF_1H
    @ __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
    @ __CONFIG    _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
    @ __CONFIG    _CONFIG4L,  _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L
    DEFINE OSC 8
    OSCCON = %01110000
    ADCON1 = %00001111  
    CMCON = 7
    
    Main:
    TOGGLE PORTE.0
    PAUSE 1000
    GOTO Main
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: 18F4523 beginner needing help to blink an LED...

    FWIW, Dave your code works in sim, (I don't have that PIC either). 2 things I had to do: comment the configs cuz I was too lazy to go fix the .INC, and I had to tie MCLR high. So question for OP, Do you have MCLR enabled AND tied high? I ask because it's an easy to miss thing.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: 18F4523 beginner needing help to blink an LED...

    I think the configs are the key here if the OP wants to use the internal OSC.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: 18F4523 beginner needing help to blink an LED...

    Well I must admit, being new to proteus, blinking that LED was like I had done it with my first PIC!! I was thinking about MCLR since I assume when I commented the configs it used the PBP default's.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: 18F4523 beginner needing help to blink an LED...

    I may have to try a sim again, when I tried it a few years ago... well it just plan was not worth the effort.

    The PBP inc configs for this chip are HS on the OSC.

    Does your sim have a resonator or something attached?

    And you may have hit it about MCLR.
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: 18F4523 beginner needing help to blink an LED...

    Well see Dave its like this: I have no idea if there is a resonator or not. I am guessing not. I didn't add 1. my entire circuit is the chip, an led, and a wire to Vcc for MCLR. But there are built in things like automatic tie in to pwr and gnd, so MAYBE? and I didn't even put a resistor in series with the LED. So these things make me go Hmmm. But the LED was blinking at what appears 1 sec rate.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

Members who have read this thread : 0

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