![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
sindyme
Joined: 05 Aug 2009 Posts: 37
|
Please help me bootloader on "PIC24F16KA101" |
Posted: Sun Feb 28, 2010 11:57 pm |
|
|
Would anyone teach me about bootloader for "PIC24F16KA101".
I have two project must to use bootloader to update firmware.
I reference "CCS" example that "EX_PCD_Bootloader.c"、"Ex_PCD_Bootload.c".
But I can't finish compiler.
It have get some Error message :
Error 23"C:\program files\PICC\devices\24F16KA101.h" Line 2(8,9):Can not change device type this far into the code
Error 48"C:\program files\PICC\devices\24F16KA101.h" Line 279(1,14):Expecting a( ... info 300 "C:\program files\PICC\devices\24F16KA101.h" Line 289(3,13):More info: First Declaration of rtc_time_t
Error 31"C:\program files\PICC\devices\24F16KA101.h" Line 289(3,13):Indentifier is already used in this scope
3 Error, 0 Warnings.
and there is my code :
Code: |
#include "C:\Documents and Settings\Chen Yang Li\My Documents\CCS_24_Series\PIC24F16KA101\0301-16KA101-bolodr\botloader-ka101.h"
#include <stdio.h>
#include <string.h>
#include "pcd_bootloader.h"
#define PIC24FJ
#define _bootloader
//Here is the sample setup for 4 different chips. The #if defined
//allows for rapid switching between chips prior to compiling.
#if defined PIC24FJ
#include <24F16KA101.h>
#fuses HS,NOWDT,NODEBUG,FRC, NOWRT, NOPROTECT
#define PUSH_BUTTON PIN_A0
//#pin_select U2TX = PIN_C9
//#pin_select U2RX = PIN_C3
//#device adc=8
#use delay(clock=22118400)
#use rs232(baud=9600, UART2)
#endif
#org default
void main()
{
setup_spi(FALSE);
setup_wdt(WDT_OFF);
setup_timer1(TMR_DISABLED|TMR_DIV_BY_1);
enable_interrupts(INT_RDA);
enable_interrupts(INT_RDA2);
delay_ms(100);
if(!input(PUSH_BUTTON))
{
#asm
goto LOADER_ADDR
#endasm
}
delay_ms(100);
fprintf(coma,"Application Ver 1.0\r\n");
fprintf(coma,"Bootloader Program\r\n");
// TODO: USER CODE!!
while(1);
}
|
|
|
![](templates/subSilver/images/spacer.gif) |
dyeatman
Joined: 06 Sep 2003 Posts: 1924 Location: Norman, OK
|
|
Posted: Mon Mar 01, 2010 7:50 am |
|
|
Try it like this
(note: I don't know what is in your include file so I can't address the errors being generated there and it is commented out. Without your include line the below compiles with no problem )
Code: | #define PIC24FJ
#if defined PIC24FJ
#include <24F16KA101.h>
#fuses HS,NOWDT,NODEBUG,FRC, NOWRT, NOPROTECT
#define PUSH_BUTTON PIN_A0
//#pin_select U2TX = PIN_C9
//#pin_select U2RX = PIN_C3
//#device adc=8
#use delay(clock=22118400)
#use rs232(baud=9600, UART2)
#endif
//#include "C:\Documents and Settings\Chen Yang Li\My Documents\CCS_24_Series\PIC24F16KA101\0301-16KA101-bolodr\botloader-ka101.h"
#include <stdio.h>
#include <string.h>
#include "pcd_bootloader.h"
#define _bootloader
*** The rest of your code after this point is unchanged ***
|
_________________ Google and Forum Search are some of your best tools!!!! |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|