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 support@ccsinfo.com

Please help me bootloader on "PIC24F16KA101"

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



Joined: 05 Aug 2009
Posts: 37

View user's profile Send private message MSN Messenger

Please help me bootloader on "PIC24F16KA101"
PostPosted: Sun Feb 28, 2010 11:57 pm     Reply with quote

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);
   

}
dyeatman



Joined: 06 Sep 2003
Posts: 1921
Location: Norman, OK

View user's profile Send private message

PostPosted: Mon Mar 01, 2010 7:50 am     Reply with quote

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