1415 views|0 replies

6555

Posts

0

Resources
The OP
 

Misunderstanding of using XF pin in DSP program interruption during programming [Copy link]

It is common to use the XF pin to flash an LED in the 5509 DSP program interrupt, but there is a misunderstanding. The following analysis is made, taking the timer to control the LED as an example: void main() { init_5509(); init_timer(); while(1) { asm(" NOP"); } } interrupt void int_timer0() { Flag=Flag+1; if (Flag>10) asm(" SSBX XF"); else asm(" RSBX XF"); if (Flag>20) Flag=0; } Copy code This program cannot achieve control. When using XF, please pay attention. XF is a bit of ST1, but in the interrupt, ST1 is first pushed into the stack and popped out of the stack before the interrupt, so changing XF in the interrupt has no practical meaning. So be careful when adding assembly in C/C++. The modified program is as follows: void main() { init_5509(); init_timer(); while(1) { asm(" NOP"); if (Flag>10) asm(" SSBX XF"); else asm(" RSBX XF"); } } interrupt void int_timer0() { Flag=Flag+1; if (Flag>20) Flag=0; } Copy the code and the program will work.

This post is from DSP and ARM Processors
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list