Experimental phenomenon: TimerA timing length is 2s. When entering the FIQ interrupt of TimerA, the output level of the lower four bits of IOA port is flipped to control the light-emitting diode connected to the lower four bits of IOA port; TimerB timing length is 1s. When entering the FIQ interrupt of TimerB, the output level of the lower four bits of IOB port is flipped to control the light-emitting diode connected to the lower four bits of IOB port. When the program is running, it can be observed that the light-emitting diode connected to the lower four bits of IOA port has a light-on and light-off cycle of 4s, while that connected to the lower four bits of IOB port is 2s.
#include "SPCE061A.H"
unsigned int n,Output1=0x00f0,Output2=0x000f;
void FIQ(void)__attribute__((ISR));
void FIQ()
{
if(*P_INT_Ctrl&0x2000)//When it is a TimerA interrupt, it is b13
{
*P_INT_Clear = 0x2000;
Output1^=0xffff;
*P_IOA_Data = Output1;
}
if(*P_INT_Ctrl&0x0800)//When the TimerB interrupt is b11
{
*P_INT_Clear = 0x0800;
Output2^=0xffff;
*P_IOA_Data = Output2;
}
}
int main( )
{
__asm("FIQ OFF");
*P_IOA_Dir = 0x00ff;
*P_IOA_Attrib = 0x00ff;
*P_IOA_Data = 0x0000;
*P_TimerA_Ctrl = 0x000d; //1024HZ selected
*P_TimerA_Data = 0xffff-2048;
*P_TimerB_Ctrl = 0x0004; //4096 selected
*P_TimerB_Data = 0xffff-4096;
*P_INT_Ctrl = 0x2800;
__asm( "FIQ ON");
while(1)
{
*P_Watchdog_Clear = 0x0001;
}
}
Previous article:External interrupts of Sunplus 16-bit MCU
Next article:Sunplus 16-bit MCU timer interrupt
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- ASML predicts that its revenue in 2030 will exceed 457 billion yuan! Gross profit margin 56-60%
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- Comparison between fixed-point dsp and floating-point dsp
- Reliability Design of PCB Board for High-speed DSP System
- Silergy SY5072 specification sheet help
- Please help me find out which movie the characters in the attached picture are from. Thank you.
- Renovation of old items + transformation of discarded charging heads into bathroom lighting
- How should I draw the various layers of the Allegro pad pins?
- MSP430 variant 3-wire SPI bus implementation (for DS1302 clock chip)
- EEWORLD University Hall----Overview of Operational Amplifier Technology
- Design of multifunctional air quality detection system based on Gizwits IoT platform
- TMS320C6678 development routine manual study 1