PIC16F819 LED not blinking


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    This gives me illegal character "&" error message......asm.51
    I have no clue what this error message is. What assembler are you using?

    asm.51
    Almost looks like you're trying to use an 8051 assembler?
    Last edited by Bruce; - 30th November 2009 at 22:13.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    Join Date
    Oct 2009
    Location
    Austin, Texas
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    I am using PICBASIC PRO from MicroCode Studio.

    In the settings window, I have selected the MPASM assembler checkbox.

    This is all I know. I reset the .inc file to where is was originally. Here it is....

    ;************************************************* ***************
    ;* 16F819.INC *
    ;* *
    ;* By : Leonard Zerman, Jeff Schmoyer *
    ;* Notice : Copyright (c) 2004 microEngineering Labs, Inc. *
    ;* All Rights Reserved *
    ;* Date : 01/07/04 *
    ;* Version : 2.45 *
    ;* Notes : *
    ;************************************************* ***************
    NOLIST
    ifdef PM_USED
    LIST
    include 'M16F81x.INC' ; PM header
    device pic16F819, hs_osc, wdt_off, pwrt_off, lvp_off, protect_off
    XALL
    NOLIST
    else
    LIST
    LIST p = 16F819, r = dec, w = -302
    INCLUDE "P16F819.INC" ; MPASM Header
    __config _HS_OSC & _WDT_OFF & _PWRTE_ON & _LVP_OFF & _CP_OFF
    NOLIST
    endif
    LIST

    I have been trying to get this MPASM Header, the way you wrote it, to compile correctly all day, but it still gives me errors.

  3. #3
    Join Date
    Oct 2009
    Location
    Austin, Texas
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    This compiles without error.....

    @__CONFIG_HS_OSC_WDT_OFF_PWRTE_ON

    But more than this will cause a "Label truncated at 32 characters" error.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Try the config line I posted above. What you're trying to do here isn't any good.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Oct 2009
    Location
    Austin, Texas
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bruce View Post
    Try the config line I posted above. What you're trying to do here isn't any good.
    Okay...I now understand what is to be done, and the changes were made as you said to the .inc file. Compile is now error free. Pop-up window settings are now as per your suggestion. Sorry for the crazy rookie mistakes. Let's see what happens now....

    Update...LED is on steady. No blinking
    Last edited by ronbowalker; - 30th November 2009 at 22:57. Reason: Info Updated...

  6. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Update...LED is on steady. No blinking
    You might want to try something like this to see your LEDs blink;
    Code:
    DEFINE OSC 4 
    @ __CONFIG _INTRC_IO & _WDT_OFF & _PWRTE_OFF & _LVP_OFF & _MCLR_OFF & _BODEN_OFF & _DEBUG_OFF
    OSCCON = %01100000  ' 4MHz 
    ADCON1=7 
    TRISA = %00000000 
    TRISB = %00000000 
    TRISB.4 = 0 
    TRISA.0 = 0 
    PORTA.0 = 0 
    PORTB.4 = 0 
    
    LOOP: 
      PORTB.4 = PORTB.4 ^ 1
      PAUSE 250
      PORTA.0 = PORTA.0 ^ 1
      PAUSE 250 
      Goto LOOP
    Check your PBP manual to see why your LEDs aren't visibly blinking with PULSEOUT...;o)
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  7. #7
    Join Date
    Oct 2009
    Location
    Austin, Texas
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bruce View Post
    You might want to try something like this to see your LEDs blink;
    Code:
    DEFINE OSC 4 
    @ __CONFIG _INTRC_IO & _WDT_OFF & _PWRTE_OFF & _LVP_OFF & _MCLR_OFF & _BODEN_OFF & _DEBUG_OFF
    OSCCON = %01100000  ' 4MHz 
    ADCON1=7 
    TRISA = %00000000 
    TRISB = %00000000 
    TRISB.4 = 0 
    TRISA.0 = 0 
    PORTA.0 = 0 
    PORTB.4 = 0 
    
    LOOP: 
      PORTB.4 = PORTB.4 ^ 1
      PAUSE 250
      PORTA.0 = PORTA.0 ^ 1
      PAUSE 250 
      Goto LOOP
    Check your PBP manual to see why your LEDs aren't visibly blinking with PULSEOUT...;o)
    Still no blink. Tried above program as well. PULSOUT did not work either...?

  8. #8
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    If you prefer to edit your 16F819.INC file, then just change it to;

    __CONFIG _INTRC_IO & _WDT_OFF & _PWRTE_OFF & _LVP_OFF & _MCLR_OFF & _BODEN_OFF & _DEBUG_OFF

    If not, then just comment it out in the .INC file & add your config settings to your code.

    Melanie posted a nice intro here http://www.picbasic.co.uk/forum/showthread.php?t=543 on setting config options.

    NOTE: This applies only to the 16F819.INC file in your PBP directory. Not the P16F819.INC
    file in your MPLAB directory. These are different. You shouldn't ever need to modify the
    P16F819.INC file in your MPLAB directory.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Simple Blinking LED - WTF!!
    By johnnylynx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st February 2010, 06:19
  2. Blinking an led problem on P16F84
    By aimenbukharie in forum General
    Replies: 1
    Last Post: - 20th March 2009, 05:00
  3. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 20:19
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. simple LED Blinking project
    By koossa in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th December 2004, 01:25

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