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


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    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!

  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 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.

  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...

    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!

  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...

    Very interesting....

    Does the LED burn out after awhile or do you have a place to set VDD to ~3 ?
    Yes... I am being a smart _ _ _ now
    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...

    in fact I think I could set it to ~3V, but I hooked her right from pin to ground, with uP at 5V. Left it running for 10 mins and still burning bright.

    This may be a case of don't fully trust the sim. Sorta like the LED thread where Darrels sim showed the different levels of brightness for different resistor values. but in real life, it works great as you and Dhuston? said.

    I don't mind a little smart $$. makes things fun
    -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
    Feb 2011
    Posts
    8


    Did you find this post helpful? Yes | No

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

    I have seen the light! The LED is now flashing!

    mackrackit,

    I tried the code you supplied but there were some problems in compiling with a message about overwriting (sorry, I cant remeber what it said), so I pasted these into the .inc file instead, only because cncmachineguy hinted at this. I'm not sure why or how this worked but it has. I'll have to spend a few days looking through all the files to work out in my head what is happening. I guess it wasn't using the internal crystal in the initial settings amongst other things.

    So a big thanks to everyone who has helped over the past few days. I never would have got there on my own...

    If anyone in the future finds this thread and wants a copy of the .inc file with the mackrackit mods then just get in touch, but it is fairly easy to do yourself. The file is in the pbp directory, called 18F4523.INC. Just load it into a text editor and comment out the original config lines, using a semi-colon, and add the four new config lines, but without the @ sign. I made a backup of the original file incase I messed something up....

    Thanks again everyone, and I expect I'll be in touch when I try to do the 12 bit a-d conversion, if I cant find the info using the search.......

  7. #7
    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...

    COOL!!!!!

    You just about have the overwriting error solved too. When you commented out the inc file to make the mods, stop there. PBP looks to the inc file for the configs, so if you want to set them in code space commenting the inc is what you do.
    http://www.picbasic.co.uk/forum/showthread.php?t=543

    There is another *.inc file that is handy. It is in 'program files/ microchip/mpasam suite/'. These inc's have all of the available config settings at the end of the file. Do not modify this file. It is for reference only.
    Dave
    Always wear safety glasses while programming.

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