|
|
View previous topic :: View next topic |
Author |
Message |
fastlink30
Joined: 14 May 2007 Posts: 33
|
mplab & ccs |
Posted: Wed Apr 10, 2013 12:48 pm |
|
|
mplab 8.90 (debug mode) & ccs 4.140 & pic18f25k50 (3.3v/16 mhz internal), debugger=mplab sim
when animate the main.c and arrive at puts() function when i press F8 appear the header file of pic18f25k50 and the pointer stay on the #device PIC18F25K50 (first line of the file header), i press 2/3 times F8 and the color of the pointer little change, but debug not continue. is this normal?
thanks |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Apr 11, 2013 12:34 am |
|
|
Are running the program with an ICD-type hardware debugger (ICD2,
ICD3, ICD-U40, etc) on a hardware board ? Or, are you running the
program in MPLAB Simulator ? MPSIM doesn't use a board.
I ask this because your post is somewhat unclear. You mention MPSIM,
but then you give us details about your Vdd voltage.
Also, post a small test program that shows the problem. Here's an example:
Code: |
#include <18F4520.h>
#fuses INTRC_IO, NOWDT, PUT
#use delay(clock=4M)
#use rs232(baud=9600, UART1, ERRORS)
//=================================
void main()
{
puts("Hello World\n\r");
while(1);
} |
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Thu Apr 11, 2013 1:32 am |
|
|
I've seen that when watchdog is enabled, and as soon as it goes to print the watchdog triggers a restart.....
Best Wishes |
|
|
fastlink30
Joined: 14 May 2007 Posts: 33
|
|
Posted: Thu Apr 11, 2013 11:32 am |
|
|
Code: |
#include <18F25K50.h>
#device adc=16
#FUSES NOWDT //No Watch Dog Timer
#FUSES WDT128 //Watch Dog Timer uses 1:128 Postscale
#FUSES INTRC_IO //Internal RC Osc, no CLKOUT
#FUSES NOBROWNOUT //No brownout reset
#FUSES BORV28 //Brownout reset at 2.8V
#FUSES WDT_NOSL //Watch Dog Timer, disabled during SLEEP
#FUSES NOPBADEN //PORTB pins are configured as digital I/O on RESET
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
//#DEVICE ICD=TRUE
#use delay(clock=16M)
#use rs232(baud=19200,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=SERIALE)
#USE SPI (MASTER, SPI1, MODE=0, BITS=8)//, STREAM=SPISTREAM)
#use fast_io(c)
#use fast_io(b)
#use fast_io(a)
//=================================
void main()
{
puts("Hello World\n\r");
while(1);
}
|
with this code when i arrive to puts(), appear window of the 18f25k50.h file and the pointer stay on the #device PIC18F25K50 line, and nothing happen, if i fress many times F8, if i make RUN command the program goes to the while(1) line.
this happen with MPLAB SIM, i not have tryed with pickit3, but i think happen the same.
with this code i not see assembly windows.
I write voltage becouse i read the reccomandation on post for forum, so , i write |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Apr 11, 2013 6:41 pm |
|
|
Try a more simple program. Compile this program, shutdown MPLAB,
then re-start MPLAB. Then press F8 and hold down the key.
It should display: Hello World
Make sure you have UART1 setup to run, in the Debugger / Settings menu.
Also make sure that 18F25K50 is selected in the Configure / Select Device menu.
Code: |
#include <18F25K50.h>
#fuses INTRC_IO, NOWDT
#use delay(clock=4M)
#use rs232(baud=9600, UART1, ERRORS)
//=================================
void main()
{
puts("Hello World\n\r");
while(1);
} |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|