Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C30 program for bootloader [solved]
#4
(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:

Code:
/******************************************************************************
* ds30 Test
*******************************************************************************
* Quartz is 10MHz
* LED is on pin RD0
******************************************************************************/

#include <p30F4012.h>

#define TRUE    -1
#define FALSE    !TRUE

//-----------------------------------------------------------------------------
//Configuration bits
//    _FOSC(CSW_FSCM_OFF & XT_PLL8);
//    _FWDT(WDT_OFF);
//    _FBORPOR(PBOR_OFF & BORV_27 & PWRT_16 & MCLR_EN);
//    _FGS(CODE_PROT_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()



Reply


Messages In This Thread
C30 program for bootloader [solved] - by Akham00 - 2010-08-22, 10:33:14
RE: C30 program for bootloader - by Lotusx - 2010-08-24, 17:51:32
RE: C30 program for bootloader - by Akham00 - 2010-08-30, 09:11:02

Forum Jump:


Users browsing this thread: 1 Guest(s)