Microcontroller › PIC › Errors when programming P18F8680
- This topic has 1 reply, 1 voice, and was last updated 10 years, 9 months ago by
James Brzycki.
-
AuthorPosts
-
May 9, 2014 at 11:50 pm #3083
James Brzycki
ParticipantHi, 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.0Stack 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 codevoid 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 #11716James Brzycki
ParticipantOk 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 theline 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 -
AuthorPosts
- You must be logged in to reply to this topic.