Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 3 months ago.
.BIN FILE FROM KEIL DUMP IN MBED
I DON'T WANT TO USE THE ONLINE COMPILER OF MBED.I WROTE THE CODE IN KEIL FOR BLINKING ALL THE LEDS ON MBED BOARD AFTER STUDYING THE SCHEMATIC OF MBED.BY USING FROMELF.EXE I EVEN CREATED A .BIN FILE AND DUMPED THAT TO MBED BOARD. BUT ITS STILL NOT WORKING.I DON'T KNOW WHERE IS THE PROBLEM.IS IT WITH MY CODE OR INCOMPATIBLE BIN FILE OR SOME THING ELSE.PLEASE HELP ME OUT.ITS URGENT.THANK YOU IN ADVANCE.
MY CODE IS AS FOLLOWS:(THERE IS NO ERROR IN THE CODE I EVEN SIMULATED THE CODE AND ITS WORKING AND I HAVE CREATED THE .BIN FILE ALSO)
- include "LPC17XX.H"
- define led1 0x040000
- define led2 0x100000
- define led3 0x200000
- define led4 0x800000 void intialise_ports(void); void intialise_timer0(void); int main(void) { NVIC_EnableIRQ(TIMER0_IRQn); ENABLING THE TIMER0 INTERRUPT intialise_ports(); intialise_timer0(); while(1); } void intialise_ports(void) { LPC_PINCON->PINSEL3=0xFFFF30CF; LPC_PINCON->PINMODE3=0xFFFF30CF; LPC_GPIO1->FIODIR=led1|led2|led3|led4; LPC_GPIO1->FIOMASK &=0xFF4BFFFF; } void intialise_timer0(void) { LPC_SC->PCONP |=0x01; TO POWER THE TIMER0 PERIPHERAL LPC_SC->PCLKSEL0 &=0xFFFFFFF3; TIMER0 PCLCK=CCLK/4 LPC_TIM0->TCR |=0x01; ENABLING THE COUNTER LPC_TIM0->CTCR &=0xFFFFFFFC; TIMER0 IN TIMER MODE LPC_TIM0->PR=0xF4240; STORING A VALUE OF 10^6 IN PRESCALER LPC_TIM0->MR0=0X12; STRING A VALUE F 18 IN MATCH REGISTER LPC_TIM0->MCR=0x00000003; ENABLING RESET ON MR0 AND INTERRUPT ON MR0 }
void TIMER0_IRQHandler(void) { LPC_GPIO1->FIOPIN ^=led1; LPC_GPIO1->FIOPIN ^=led2; LPC_GPIO1->FIOPIN ^=led3; LPC_GPIO1->FIOPIN ^=led4; LPC_TIM0->IR=0x01; }
Use
posted by Erik - 09 Oct 2013<<code>> and <</code>>
to make your code readable. Also disabling your caps lock helps. Finally that you don't want to use the online compiler doesn't mean you can't use mbed code.Hello pavan talluri,
why you don't flash your board and open debug session to find out what's wrong with your code? That's the fastest way to discover the bug. You own all required resources (board, CMSIS-DAP, KEIL).
Regards,
posted by Martin Kojtal 09 Oct 20130xc0170