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

18f87k22 bootloader

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



Joined: 10 Feb 2011
Posts: 241
Location: Vancouver, BC

View user's profile Send private message

PostPosted: Fri Mar 11, 2011 11:15 am     Reply with quote

I got microchip application note AN1310 working fine on my 18f87k22 on the picdem pic18 explorer demo board. I can properly enter the bootloader mode by selecting the "break" button in the delivered software which pulls pin B1 to GND. This works well but when I manually hook pin B1 up to GND and reset the PIC, it won't enter the bootloader mode, i'm not getting it! Why does this not work? by pressing the "break" button in the pc software, we're setting the RTS pin which again is connected to reset pin B1....
same manually isn't working - that may also be the reason why I can't get the CCS bootloader working for me... any clues?
Thank you!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Mar 11, 2011 5:36 pm     Reply with quote

I don't have your PIC, but I was able to make it work with an 18F45K22.
To make it work, I had to do this:

1. Edit Ex_Bootloader.c as shown below in bold:
Quote:

#elif defined(__PCH__)
#include <18F45K22.h>
#fuses HSH,NOWDT,NOPROTECT,NOPLLEN

#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
#endif

and also in this section:
Quote:

#if defined(__PCH__)
#org 0x40,0x9F // *** WAS 0x7F
#else
#org 0x20,0x3F
#endif
void main(void) {

2. Edit the Ex_Bootload.c file as shown below in bold:
Quote:

#elif defined(__PCH__)
#include <18F45K22.h>
#fuses HSH,NOWDT,NOPROTECT,NOPLLEN

#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
#endif

(Note: This is a different file than Ex_Bootloader.c)

Then use TeraTerm to follow the instructions in this link exactly:
http://www.ccsinfo.com/forum/viewtopic.php?t=40920&start=1

If it doesn't work, possible reasons are:

1. You forgot to select the correct PIC in the MPLAB Configure/ Select
Device menu, for both programs. In my case, this is 18F45K22.

2. You forgot to add the NOPLLEN setting to the #fuses in both files.

3. You forgot to enable Xon/Xoff in TeraTerm, in the Setup / Serial Port/
Flow Control window. Note: TeraTerm doesn't retain this setting when
you shut down the program, unless you specifically "save" the settings.
It won't work without Xon/Xoff enabled and it is very easy to
shut down TeraTerm, start it back up, and forget to re-enable Xon/Xoff.

4. You forgot to unplug the ICD2 after programming Ex_bootloader.hex
into the PIC, or you forgot to jumper pin B5 to ground, or you forgot to
press the reset button on the board prior to downloading the application
program.

5. You accidently used TeraTerm to send the source file of the application
program, Ex_Bootload.c, instead of the hex file, Ex_Bootload.hex.
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