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

Problem with CCS 18F458 bootloader

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



Joined: 22 Sep 2003
Posts: 101
Location: Cape Town (South africa)

View user's profile Send private message Send e-mail Visit poster's website

Problem with CCS 18F458 bootloader
PostPosted: Sun Jun 06, 2004 1:33 am     Reply with quote

I use the ICDU to download the CCS bootloader to 3 boards. 2 boards are exactly the same having 18F458 Quad Flat Packs and one is vero board with a DIP 18F458. The download works perfectly with the ICD.

A bit of history - RS232 ports work perfectly on all three boards - I loaded the entire app into all three devices before the code was changed to be bootloaded. The serial ports are configured at 19200 and the devices are running at 20MHz. I comunicated perfectly with all three boards via 19200 serial.

Now this is where it gets very strange.

On board A :
If I try to download the app via SIOW or the VB bootloader that another member made available - then it work completeley about 80% of the time. It times out halfway the other 20 % of the time.

On board B:
The downloder gets to about 40% of the download and then times out.

On the Veroboard (C):
The downloader times out after about 2% of code loaded.

The things that I have tried to date:
1. Installed another 2 Serial ports on the PC and tried to download via the new ports.
2. Tried to download via the USB T0 RS232 convertor.
3. Changed the bootloader speed from 19200 to 9600 then to 2400.
4. Set all the protection flags to NOPROTECT
5. Changed the timeout in the VB code to 5 seconds.

Note:
(RTS and CTS) are not implemented on any of the boards.
If the loader code is chaged I change the color of an LED to prove that the new code has been loaded.

The results are always exactly the same on all three the boards -
One loads 80% of the time;
One loads 40% of the code before timing out
One loads 2% of the code before timing out

Any ideas?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jun 06, 2004 3:28 pm     Reply with quote

I have no experience with the CCS bootloader.
But here's something to try:

Go into the Control Panel in Windows. Follow this menu path:

Control Panel / Device Manager / Com Ports / Properties /
Port Settings / Advanced / Fifo Buffers

(The menu path might be slightly different, depending on
your version of Windows).

Then either disable them, or set them on their lowest setting.
Here's a link that shows what I'm talking about.
http://www.frii.com/support/knowledgebase/viewArticle.php?articleID=99
hillcraft



Joined: 22 Sep 2003
Posts: 101
Location: Cape Town (South africa)

View user's profile Send private message Send e-mail Visit poster's website

Big buffer
PostPosted: Mon Jun 07, 2004 12:35 am     Reply with quote

The CCS loader.c creates a huge buffer to hold the entire line of code before it is actually loaded into the PIC.

Would it not be better to work with a smaller buffer and more ack/nack between the PC and the PIC
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Mon Jun 07, 2004 1:05 am     Reply with quote

The buffer is not that big (64 bytes) and since you won't return from the loader function, you can locate the buffer on the RAM normally used by other variables (this will destroy those variables but it doesn't matter since you'll have to reset the PIC anyway).

Or you can always modify the Loader.c to work the way you want. You'll then need to write the PC side as well.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Jun 07, 2004 5:15 pm     Reply with quote

Which compiler version are you using? V3.202 mentions some bug fixes in the boot loader.
hillcraft



Joined: 22 Sep 2003
Posts: 101
Location: Cape Town (South africa)

View user's profile Send private message Send e-mail Visit poster's website

No real progress
PostPosted: Tue Jun 08, 2004 4:41 am     Reply with quote

I have converted the VB to Delphi. (I just just more comfortable with Delphi). The Delphi app reacts exactly the same.

Disabling the FIFO buffer makes no difference.
The 64byte buffer does not seem to be the problem because the loader does work perfectly on one 18F458.

I do not have version .202 Can someboby please mail me ex_bootloader.c bootloader.h and loader.c from version 202

My mail address is adrianh@hillcraft.co.za

I will publish my final Delphi and CCS code in the code library as soon as it works!
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