View previous topic :: View next topic |
Author |
Message |
hillcraft
Joined: 22 Sep 2003 Posts: 101 Location: Cape Town (South africa)
|
Problem with CCS 18F458 bootloader |
Posted: Sun Jun 06, 2004 1:33 am |
|
|
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
|
|
Posted: Sun Jun 06, 2004 3:28 pm |
|
|
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)
|
Big buffer |
Posted: Mon Jun 07, 2004 12:35 am |
|
|
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
|
|
Posted: Mon Jun 07, 2004 1:05 am |
|
|
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
|
|
Posted: Mon Jun 07, 2004 5:15 pm |
|
|
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)
|
No real progress |
Posted: Tue Jun 08, 2004 4:41 am |
|
|
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! |
|
|
|