EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Errors when programming P18F8680

Errors when programming P18F8680

|

Microcontroller › PIC › Errors when programming P18F8680

  • This topic has 1 reply, 1 voice, and was last updated 11 years, 11 months ago by James Brzycki.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 9, 2014 at 11:50 pm #3083
    James Brzycki
    Participant

    Hi, first off I have already looked through some posts and have not found anything that pertains to me, if you know of one that might help please let me know. I am not new to C code but do not have a lot of experience. I am in school learning embedded systems using the SSE8680 dev board. I am using the  MPLAB IDE 8.92 with the C18 compiler and Tera Term. The codes build just fine and no errors in MPLAB.
     
    The issue at hand is when I send the file to the chip instead of showing (…………….S) it shows
     
    Ready to load
    .EEEEEEEF  <


    (NOT RIGHT)
    Hit enter to reset
    PICMON 18F8680 v2.7.1 (c) 2004, Shujen Chen
    Hit any key to enter monitor: 2.1.0

    Stack underflow!  <


    (NOT RIGHT)
    W=00 NozDc PC=0000:EFCC GOTO   0xFF98

     
    Now I have done some other codes in C and they transfer just fine and work. I am looking for an explanation on stack underflow and how to fix it. I have no clue, I have looked at other forums and the data sheet and still have no clue what it means or how to remedy it. I have attached the program that the above error came about with. This program and some others I have tried do the same and are out of my book. Thanks

     

     

    #include <p18f8680.h>
    #include <timers.h>

    void int_TMR0 (void);
    static unsigned char count;

    #pragma code high_vector = 0x08
    void high_interrupt (void)
    {
        _asm
        goto int_TMR0
        _endasm
    }
    #pragma code

    #pragma interrupt int_TMR0
    void int_TMR0 (void)
    {
        if(INTCONbits.TMR0IF){
            INTCONbits.TMR0IF = 0;
            count++;
            PORTD = ~count;
            TMR0H = 0x00;
            TMR0L = 0x03;
            T0CONbits.TMR0ON=1;
        }
    }
    #pragma code

    void main (void)
    {
        count = 0;
        TRISD = 0;
        PORTD = ~count;
        RCON = 0xFF;
        INTCON = 0xE0;
        TMR0H = 0x00;
        TMR0L = 0x03;
        T0CON = 0xC2;
        while (1);
    }

    May 10, 2014 at 5:37 pm #11716
    James Brzycki
    Participant
    Ok so after reading quite a bit of the dev board manual I found this.
     
    When attempt to download outside of the user program address, an ā€œEā€ is printed and the
    line is ignored. This usually happened when CONFIG registers are programmed.
    Download cannot modify CONFIG registers.
     
    This says why Im getting the E’s when transferring my HEX file but I dont knowwhat it means or how to fix it. The manual doesnt go into detail about it.
     
    Thanks
  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • timing delay code statements using Swordfish April 20, 2026
  • S1MJ ? April 20, 2026
  • Bot checks April 19, 2026
  • Getting into an LED bulb April 19, 2026
  • Understanding reversing polarity at astable multivibrator April 19, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise