Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C30 program for bootloader [solved]
I'm an happy user of Tiny Bootloader on 16F and 18F pics but now I'm testing your nice bootloader for a dsPIC30F.
I've successfully configured your bootloader and burned it on a dsPIC and now I'm able to connect to the board with your GUI PC program.
But I'm not able to write a C30 program to be loaded on my board, even a simple one (the usual LED flash).
It seems that the bootloader loads the program but doesn't run it.

In the bootloader documentation there is a short paragraph about using C30 but it's too cryptic to me.

Do you have a simple example to start from?

Thank you for your nice and complete work!

Could you provide more information :
# Device name
# Firmware version
# GUI version

and post you MPLAB project.


There's nothing special you need to do becuase you use C30. The part in the manual is about combining the bootloader and user application in one single MPLAB project.

Please post more information as Lotusx describes.
(2010-08-25, 20:58:12)mackey Wrote: There's nothing special you need to do becuase you use C30 ...

Thank you for your reply. You are right (of course!).
After your reply I checked again my test software and found the error.
Now the test board is very well working with your bootloader.

As you say, nothing special need to be done on the C30 program.
Just for reference for others, I write here my very simple working test program:

* ds30 Test
* Quartz is 10MHz
* LED is on pin RD0

#include <p30F4012.h>

#define TRUE    -1
#define FALSE    !TRUE

//Configuration bits
//    _FWDT(WDT_OFF);

//Program Specific Constants
#define FCY 20000000 //Instruction cycle rate (Osc x PLL / 4)

//Main routine
int main(void) {
    long    i, a ;

    LATD = 0x0000;         //Initialize LED pin data to off state
    TRISD = 0xfff0;     //Set LED pins as outputs
    LATDbits.LATD0 = 1; //Turn LED RD0 on

    while (TRUE) {
        for ( i=0; i<500000; i++) {
            a = i + 1 ;

        LATDbits.LATD0 = 1; //Toggle LED RD4 when S1 not pressed
        //LATDbits.LATD1 = 0; //Turn off LED RD5

        for ( i=0; i<500000; i++) {
            a = i + 1 ;

        LATDbits.LATD0 = 0; //Turn off LED RD4
        //LATDbits.LATD1 ^= 1; //Toggle LED RD5 when S1 is pressed
} //End of main()


Forum Jump:

Users browsing this thread: 1 Guest(s)