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.
10 years, 8 months ago. This question has been closed. Reason: test
a
#include "mbed.h" uint32_t a = LPC_TIM2->IR; /*!< (@ 0x40014000) Interrupt Register */ uint32_t b = LPC_TIM2->TCR; /*!< (@ 0x40014004) Timer Control Register */ uint32_t c = LPC_TIM2->TC; /*!< (@ 0x40014008) Timer Counter */ uint32_t d = LPC_TIM2->PR; /*!< (@ 0x4001400C) Prescale Register */ uint32_t e = LPC_TIM2->PC; /*!< (@ 0x40014010) Prescale Counter */ uint32_t f = LPC_TIM2->CCR; /*!< (@ 0x40014028) Capture Control Register */ uint32_t g = LPC_TIM2->CR0; /*!< (@ 0x4001802C) Capture Register. CR 0 */ uint32_t h = LPC_TIM2->CR1; /*!< (@ 0x40018030) Capture Register. CR 1 */ uint32_t i = LPC_TIM2->CTCR; /*!< (@ 0x40014070) Count Control Register */ int main() { printf("hello world\n\r"); #define SET_TCR 0x0001 #define SET_IR 0x0001 //NVIC_SetPriority(TIMER2_IRQn, (uint32_t)mytTim0Handler); NVIC_DisableIRQ(TIMER3_IRQn); NVIC_EnableIRQ(TIMER2_IRQn); LPC_TIM2->TCR = SET_TCR; LPC_TIM2->IR = SET_IR; LPC_PINCON->PINSEL0 |= (1<<8) | (1<<9) | (1<<10) | (1<<11); printf("after %i",LPC_PINCON->PINSEL3); printf("IR = %i\n\r", a); printf("TCR = %i\n\r", b); printf("TC = %i\n\r", c); printf("PR = %i\n\r", d); printf("PC = %i\n\r", e); printf("CCR = %i\n\r", f); printf("CR0 = %i\n\r", g); printf("CR1 = %i\n\r", h); printf("CTCR = %i\n\r", i); while(1){ printf("TCR = %i\n\r", b); uint32_t c = LPC_TIM2->TC; /*!< (@ 0x40014008) Timer Counter */ uint32_t l = LPC_TIM2->CR0; printf("TC = %i\n\r", c); printf("CR0 = %i\n\r", g); wait(1); } }