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

Boot Loader Issue for 18Fxxx

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



Joined: 06 Jul 2007
Posts: 5
Location: bangalore

View user's profile Send private message Yahoo Messenger

Boot Loader Issue for 18Fxxx
PostPosted: Tue Jul 10, 2007 2:34 am     Reply with quote

Hi All,

Am a new member to this forum. Am using PCWH Compiler Version 3.241

Am trying to use Boot Loader 'ex_bootloader.c' ,provided by the PCWH Compiler with PIC18F258 Device.

This bootloader is designed to detect pin B5 low on reset. It will then use the RS232 link to download a new program.Otherwise the application program is started.

Changes made to the code:

Changed the device from 18f452 to 18F258, modified the clock to 40Mhz with baudrate 9600.

Compiled and flashed the program into the chip successfully. Loaded the application (ex_bootload.c) .Hex file through Siow (file/open file). when am using download software option in siow am getting a message as 'time out while downloading'.

Problem Situation:

Am getting the acknowledgement for each of the hex lines (application has 25 hex lines) but the application is not running!!!!!!!!!!!!!!!!

Question:

What could be the problem? whether the code is not writing to the program memory or my seetings (address/configuration) had went wrong?

Please advise me,if anyone knows.
_________________
lipeesh
jma_1



Joined: 08 Feb 2005
Posts: 147
Location: Wisconsin

View user's profile Send private message

PostPosted: Tue Jul 10, 2007 10:55 am     Reply with quote

Greetings,

I'm not sure I understand your problem. Is your question, after loading the application does not start? Have you tried power cycling the pic after loading the software (ensure B5 is in the correct state)?

Things to check:
Verify the clock rate is modified for both the boot_load and boot_loader
Verify you are programming the boot_loader.c with a device programmer into the pic
Do you have ICD=TRUE specified? -> remove if yes
Have you added anything to the example software(specifically interrupts to the software)?
What device programmer are you using? (are the fuses correct?)

Cheers
lipeesh



Joined: 06 Jul 2007
Posts: 5
Location: bangalore

View user's profile Send private message Yahoo Messenger

PostPosted: Tue Jul 10, 2007 10:53 pm     Reply with quote

Am using ICD U-40 device programmer.

This is my cofiguration as well as clock and baudrate setting in both boot code and application. moreover i havn't included any new line to the existing application code.

Configuration,clock and baudrate settings:

#include <18F258.h>
#FUSES NOWDT //Watch Dog Timer
#FUSES WDT16 //Watch Dog Timer uses 1:8 Postscale
#FUSES H4 //High speed osc with HW enabled 4X PLL
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOOSCSEN //Oscillator switching is disabled, main oscillator is source
#FUSES BROWNOUT //Reset when brownout detected
#FUSES BORV27 //Brownout reset at 2.7V
#FUSES NOPUT //No Power Up Timer
#FUSES CPD //EE protection
#FUSES NOSTVREN //Stack full/underflow will not cause reset
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOLVP //low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOWRT //Program memory not write protected
#FUSES NOWRTD //Data EEPROM not write protected
#FUSES WRTB //Boot block write protected
#FUSES CPB //Boot Block Code Protected
#FUSES NOWRTC //configuration not registers write protected
#FUSES NOEBTR //Memory not protected from table reads
// #FUSES EBTRB //Boot block not protected from table reads
#FUSES WRTB //Boot block write protected
#use delay(clock=40000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)


Application Code

#include <bootloader.h>

void main(void)
{
int i=0;
printf("\r\nApplication program version 1.00 \r\n");

while(TRUE)
printf("%u ",++i);
}
_________________
lipeesh
jma_1



Joined: 08 Feb 2005
Posts: 147
Location: Wisconsin

View user's profile Send private message

PostPosted: Wed Jul 11, 2007 6:42 am     Reply with quote

Greetings,

The max speed is 40 MHz -> H4 (HS4 in data sheet). Do you have a 10 Mhz clock? Do the clock settings match the code loaded into the pic with the programmer? If the clock rate is incorrect, you will only see garbage on the RS232. Try toggling an output on the PIC and ensure your application is running after the download. If the registers are not reset manually, power cycle the micro after the download. Perhaps try the example software and only change to the appropriate clock rate (compiler issue?). Try including the ERRORS statement into the RS232 setup.

JMA-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