Trouble with most basic BLINK on PIC 16F819


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    By the way, that link should be

    http://www.microchip.com/wwwproducts...cName=en010227

    Sorry!

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


    Did you find this post helpful? Yes | No

    Default

    ADCON1=2
    This will set all pin to analog, hence why you experiment some problem

    Try
    ADCON1=7
    This will disable all analog stuff.

    100K for MLCR is tad high. Something <10K is more standard.

    Double check your config fuses setting, INTRC, MCLR and LVP. LVP should be set to off.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    Here's some handy links for you

    PortA Doesn't Work
    http://www.picbasic.co.uk/forum/showthread.php?t=561


    Presetting Configuration Fuses (PIC Defines) into your Program
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    Steve

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

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Here's some handy links for you

    PortA Doesn't Work
    http://www.picbasic.co.uk/forum/showthread.php?t=561


    Presetting Configuration Fuses (PIC Defines) into your Program
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    These 2 links should be required reading to register here. IMHO
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5


    Did you find this post helpful? Yes | No

    Default Thanks everyone!

    Thanks everyone for responding so fast with such detailed help!! I am at work now but will give these things a shot when I get home, including reading through the docs you linked to.

    One question to Steve (mister_e) though: I thought what I was doing with going high and low out on the pin was analog out, no? Or am I confused about what analog/digital means in this case? Does analog give me a potential range of values vs. digital giving me just two (high/low a.k.a. on/off a.k.a. 0/1) values? As I write it out it seems more and more obvious to me...

  6. #6


    Did you find this post helpful? Yes | No

    Default Okay, getting closer.

    So, I've read through the docs and things are starting to be much more clear, I'm understanding what is important in the data sheet vs. not. I think I'm almost there but what I'm seeing is the led going on once when I power up but then stopping. Does this sound familiar to any of you?

    Thanks again for all your help--

    Best,
    Dave

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


    Did you find this post helpful? Yes | No

    Default

    Well this doesn't sounds familiar, unless the configuration fuses are not properly programed by your Device Programmer.

    Program your PIC, read it back. See if the config fuses stay the same.

    You could still post your .HEX file here (change the extension to .TXT), so we could try it world-wide
    Steve

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

  8. #8
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default

    These are some of the configuration data that I 'embed' at the top of the source file to inform the programmer which fuses to set. This, of course, is for a PIC16F917. You will need to check which fuses apply for the 819 and set them accordingly.

    Code:
    @  device  pic16f917
    @  device  INTRC_OSC_NOCLKOUT,WDT_OFF,PWRT_ON,MCLR_OFF
    @  device  PROTECT_ON,BOD_OFF,CPD_ON,IESO_OFF,FCMEN_ON
    
    define     NO_CLRWDT    1
    define          OSC     4       ' OSCCON defaults to 4MHz on reset

Similar Threads

  1. Sending Commands from Visual Basic about IR to Pic
    By tne_de in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th April 2009, 06:09
  2. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  3. using AND as an IF statement
    By dw_pic in forum mel PIC BASIC
    Replies: 27
    Last Post: - 8th June 2006, 18:05
  4. vb6 to pic basic
    By Darrenmac in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 19th December 2005, 01:56
  5. The Ultimate PIC Basic
    By picnaut in forum PBP Wish List
    Replies: 4
    Last Post: - 9th November 2004, 22:10

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