About Timer16_0 code:
Keywords:LPC1114
Reference address:LPC1114_Timer16_0 interrupt program_MDK compilation environment
LPC_SYSCON->SYSAHBCLKCTRL |= (1<<7); //Start the timer clock
LPC_TMR16B0->PR=1000;//1000-1; //Prescaler counter
LPC_TMR16B0->MR0=12000; //match register
LPC_TMR16B0->TCR=0x1; //Start the timer counter
LPC_TMR16B0->MCR=3;//(1<<0)&(1<<1); //Match control--matching triggers an interrupt and resets the timer
NVIC_EnableIRQ(TIMER_16_0_IRQn); //Interrupt enable
Timer16_0 interrupt routine:
void TIMER16_0_IRQHandler(void)
{
if ( LPC_TMR16B0->IR & 0x1 )
{
LPC_TMR16B0->IR = 1; /* clear interrupt flag */
//timer16_0_counter++;
GPIOSetValue( 0, 3, 0 ); //Write 0 to P0.3
Delay_Ms(100);
GPIOSetValue( 0, 3, 1 ); //Write 0 to P0.3
Delay_Ms(100);
}
if ( LPC_TMR16B0->IR & (0x1<<4) )
{
LPC_TMR16B0->IR = 0x1<<4; /* clear interrupt flag */
timer16_0_capture++;
}
return;
}
Previous article:32-bit microcontroller LPC11C14 learning
Next article:LPC1114_External interrupt program_MDK compilation environment
- Popular Resources
- Popular amplifiers
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
MoreDaily News
- Industry first! Xiaopeng announces P7 car chip crowdfunding is completed: upgraded to Snapdragon 8295, fluency doubled
- P22-009_Butterfly E3106 Cord Board Solution
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
Guess you like
- Display bit variable icon--LCD display
- EEWORLD University Hall--Keysight World 2019 Automotive Forum Review
- A programmer was writing code on the subway and was criticized by passers-by: What's so great about that!
- It was revealed online that an interviewer at Bilibili belittled the enrollment of Beijing University of Posts and Telecommunications. The relevant person in charge responded that the statement was untrue.
- RT-Thread device framework learning RTC device
- Orcad learning notes (three) class and sub class in PCB
- [Hua Diao Experience] 17 Beetle ESP32C3 and WS2812 screen music visualization rhythm light
- EEWORLD University----42/5000 Power over Ethernet (PoE) Training Series
- How to effectively program a microcontroller active buzzer driver
- MSP430 SPI reads AFE4400 register value code