CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

mplab & ccs

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
fastlink30



Joined: 14 May 2007
Posts: 33

View user's profile Send private message

mplab & ccs
PostPosted: Wed Apr 10, 2013 12:48 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Apr 11, 2013 12:34 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Apr 11, 2013 1:32 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Apr 11, 2013 11:32 am     Reply with quote

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 Smile
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Apr 11, 2013 6:41 pm     Reply with quote

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);
}
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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