Going backwards, can't even get a basic blinky working now


Results 1 to 27 of 27

Threaded View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,625

    Question Going backwards, can't even get a basic blinky working now

    Started trying to get USART going on the LAB X1, but was getting garbage - couldn't figure it out, so I moved to a breadboard and started at the beginning. It doesn't get much more basic than this on a 16F877; blinky on pin D1.

    Code:
    #CONFIG
        __config _HS_OSC & _WDT_OFF & _WRT_OFF & _BODEN_ON & _LVP_OFF  & _CPD_OFF & _PWRTE_OFF & _DEBUG_OFF
    #ENDCONFIG
    
    DEFINE  OSC     20
    
    ADCON1 = 7              ' A/D off, all digital
    TRISD = %00000000
    PORTD = %00000000
    
    START:  PORTD = %00000000
            PAUSE   500      
            PORTD = %00000010
            PAUSE   500      
    
            GOTO    START
    Finish: end
    Compiled using PK4 successfully:

    Code:
    DFP Version Used : PIC16Fxxx_DFP,1.4.149,Microchip
    *****************************************************
    
    Connecting to MPLAB PICkit 4
    Currently loaded versions:
    Application version...........00.09.46
    Boot version..................01.00.00
    Script version................00.05.58
    Script build number...........abbfe90327
    Tool pack version ............1.15.1688
    Target voltage detected
    Target device PIC16F877 found.
    Device Revision Id  = 0x6
    Device Id = 0x9a0
    *****************************************************
    Erasing...
    Erase successful
    *****************************************************
    Erasing...
    The following memory area(s) will be programmed:
    program memory: start address = 0x0, end address = 0x1fff
    EEData memory
    Programming/Verify complete
     Program Report
    01-May-2023, 17:01:53
    Device Type:PIC16F877
    Program Succeeded.
    PK4 Verify Report
    01-May-2023, 17:01:53
    Device Type:PIC16F877
    *****************************************************
    The following memory area(s) will be verified:
    program memory: start address = 0x0, end address = 0x1fff
    EEData memory
    Verification successful.
    Verify Succeeded.
    • I added two power LEDs at the top to show both rails are powered.

      Blinky LED is on pin D1, and yet nothing happens.

      LED comes on if I manually apply 5V to pin.

      I've changed 20MHz OSC and caps.

      Changed MCU.

    I've been trying to figure this out for waaaay too long now, I feel I'm getting dumber by the minute.

    Robert

    Name:  Blinky 16F877.jpg
Views: 2608
Size:  181.2 KB


    EDIT: For a sec I thought my CONFIG was obsolete, but that looks ok.
    Last edited by Demon; - 1st May 2023 at 22:27.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. DT_INTS-14 (Blinky Light) Help ?
    By andybarrett1 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th November 2015, 21:28
  2. Replies: 3
    Last Post: - 15th April 2015, 04:58
  3. 12F683 - basic code not working
    By Scampy in forum mel PIC BASIC Pro
    Replies: 56
    Last Post: - 12th February 2014, 00:29
  4. Blinky not working with TOGGLE
    By AndrewC in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd November 2008, 08:45
  5. My first Blinky!
    By nomad in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 25th September 2007, 17:29

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