This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
大家好:
1. 想請問MSP430F5529 在使用RTOS下使否能製作TIMER_A的ISR?
2. MSP430F5529在RTOS下,是否能創造一個3us的timer出來?
3. MSP430F5529在RTOS下是否可以使用 #pragma vector=TIMER1_A0_VECTOR,因為設定後compiler都會顯示錯誤
(Description Resource Path Location Type symbol "__TI_int59" redefined: first defined in "./main.obj"; ....)
Hi Zheng Wei Huang,
1. 可以,这个属于硬件中断;
2. 可以,不过取决于您的时钟配置,低速时钟应该是不行的;
3. 我询问下相关工程师后回复您。
Hi Yale,
1. 可以,这个属于硬件中断;>>> 請問要怎樣實作,目前沒有找到相關文件說明
2. 可以,不过取决于您的时钟配置,低速时钟应该是不行的 >>> MSP430F5529在TI-RTOS下是使用SMCLK,請問有辦法達到0.3us嗎?
3. 我目前想要在MSP430F5529且使用TI-RTOS下產生下列waveform,請問有辦法做到嗎? 如果可以,要怎麼實作或文件說明呢?
謝謝。
3. MSP430F5529在RTOS下是否可以使用 #pragma vector=TIMER1_A0_VECTOR,因為設定後compiler都會顯示錯誤
(Description Resource Path Location Type symbol "__TI_int59" redefined: first defined in "./main.obj"; ....)
有没有尝试使用一下TIMER例程中的格式(如下方所示)去定义TIMER的ISR?
// Timer0 A0 interrupt service routine #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) #pragma vector=TIMER0_A0_VECTOR __interrupt void TIMER0_A0_ISR(void) #elif defined(__GNUC__) void __attribute__ ((interrupt(TIMER0_A0_VECTOR))) TIMER0_A0_ISR (void) #else #error Compiler not supported! #endif { P1OUT ^= 0x01; // Toggle P1.0 }
1. 可以,这个属于硬件中断;>>> 請問要怎樣實作,目前沒有找到相關文件說明
https://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/index.html
SDK中有例程,下载链接↑↑↑;
用户指南:spruhu4e_TI-RTOS 2.20 for MSP43x Getting Started Guide
2. 可以,不过取决于您的时钟配置,低速时钟应该是不行的 >>> MSP430F5529在TI-RTOS下是使用SMCLK,請問有辦法達到0.3us嗎?
时钟信号选择SMCLK是可以的,但是时钟源要选择高速时钟源(比如XT1CLK);
3. 我目前想要在MSP430F5529且使用TI-RTOS下產生下列waveform,請問有辦法做到嗎? 如果可以,要怎麼實作或文件說明呢?
如回复1。
--
如果您哪里还有什么不明白的地方,请告诉我们
Hi Yale,
我就是按照這方式去compiler才出現(Description Resource Path Location Type symbol "__TI_int59" redefined: first defined in "./main.obj"; ....)
Hi Zheng Wei Huang,
我就是按照這方式去compiler才出現(Description Resource Path Location Type symbol "__TI_int59" redefined: first defined in "./main.obj"; ....)
跟进过去了;
MSP430F5529在TI-RTOS下,能否使用PWM+DMA去產生如上的波型?
可以。
SDK中有PWM的例程。
如果您对RTOS不是很熟悉的话,建议不要使用这种方式
Hi Yale,
1. 跟进过去了;>>> 這是什麼意思?
2. 我知道一般PWM怎麼去使用,但如何做到可以一直切換duty cycle部分呢?(如我上述波型)
3. 你是指說在RTOS下,不適合使用DMA方式來產生一組可任意修改duty的PWM嗎? 為什麼?
謝謝。
Hi Zheng Wei Huang,
1. 跟进过去了;>>> 這是什麼意思?
我把您提供的信息跟进给相关的工程师了。
请提供一下您的工程,我们的工程师帮您调试一下;
2. 我知道一般PWM怎麼去使用,但如何做到可以一直切換duty cycle部分呢?(如我上述波型)
有关DMA-PWM我需要再看一下相关的部分后回复您;
3. 你是指說在RTOS下,不適合使用DMA方式來產生一組可任意修改duty的PWM嗎?
不是。我们推荐熟悉RTOS的用户来使用RTOS进行开发。
--
谢谢
Hi Yale,
我簡單執行下列程式碼在TI-RTOS下,compiler就有error了
/* XDCtools Header files */
#include <xdc/std.h>
#include <xdc/runtime/System.h>
/* BIOS Header files */
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
/* TI-RTOS Header files */
#include <ti/drivers/GPIO.h>
/* Board Header file */
#include "Board.h"
#include "driverlib.h"
#define COMPARE_VALUE 50000
void main (void)
{
//Stop WDT
WDT_A_hold(WDT_A_BASE);
//Set P1.0 to output direction
GPIO_setAsOutputPin(
GPIO_PORT_P1,
GPIO_PIN0
);
//Start timer in continuous mode sourced by SMCLK
Timer_A_initContinuousModeParam initContParam = {0};
initContParam.clockSource = TIMER_A_CLOCKSOURCE_SMCLK;
initContParam.clockSourceDivider = TIMER_A_CLOCKSOURCE_DIVIDER_1;
initContParam.timerInterruptEnable_TAIE = TIMER_A_TAIE_INTERRUPT_DISABLE;
initContParam.timerClear = TIMER_A_DO_CLEAR;
initContParam.startTimer = false;
Timer_A_initContinuousMode(TIMER_A1_BASE, &initContParam);
//Initiaze compare mode
Timer_A_clearCaptureCompareInterrupt(TIMER_A1_BASE,
TIMER_A_CAPTURECOMPARE_REGISTER_0
);
Timer_A_initCompareModeParam initCompParam = {0};
initCompParam.compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_0;
initCompParam.compareInterruptEnable = TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE;
initCompParam.compareOutputMode = TIMER_A_OUTPUTMODE_OUTBITVALUE;
initCompParam.compareValue = COMPARE_VALUE;
Timer_A_initCompareMode(TIMER_A1_BASE, &initCompParam);
Timer_A_startCounter( TIMER_A1_BASE,
TIMER_A_CONTINUOUS_MODE
);
//Enter LPM0, enable interrupts
__bis_SR_register(LPM0_bits + GIE);
//For debugger
__no_operation();
}
//******************************************************************************
//
//This is the TIMER1_A3 interrupt vector service routine.
//
//******************************************************************************
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=TIMER1_A0_VECTOR
__interrupt
#elif defined(__GNUC__)
__attribute__((interrupt(TIMER1_A0_VECTOR)))
#endif
void TIMER1_A0_ISR (void)
{
uint16_t compVal = Timer_A_getCaptureCompareCount(TIMER_A1_BASE,
TIMER_A_CAPTURECOMPARE_REGISTER_0)
+ COMPARE_VALUE;
//Toggle P1.0
GPIO_toggleOutputOnPin(
GPIO_PORT_P1,
GPIO_PIN0
);
//Add Offset to CCR0
Timer_A_setCompareValue(TIMER_A1_BASE,
TIMER_A_CAPTURECOMPARE_REGISTER_0,
compVal
);
}
Hi Yale,
1. 附上 MSP430F5529_TIMER.zip (使用的RTOS版本為: tirtos_msp43x_2_20_00_06)
2. 請問能否順便教學在TI-RTOS下如何在MSP430F5529上使用PWM+DMA來改duty的功能嗎?
謝謝。
Hi Zheng Wei Huang,
1. 附上 MSP430F5529_TIMER.zip (使用的RTOS版本為: tirtos_msp43x_2_20_00_06)
我已经提交给相关工程师了;
2. 請問能否順便教學在TI-RTOS下如何在MSP430F5529上使用PWM+DMA來改duty的功能嗎?
这个问题我也已经向相关工程师咨询了。
--
感谢您的耐心等候,有了结果我会第一时间回复
1. 要创建中断ISR,需要在TI-RTOS中创建Hwis。更多信息,您可以参考本文档第 3.4 节,其中有创建的示例:
spruex3v_SYS/BIOS (TI-RTOS Kernel) User's Guide (Rev. V)
2. 您只需要为DMA的single destination设置一个增加的源。一般使用第二个TIMER触发DMA;因为您想通过TI-RTOS的task来控制,所以触发源应该是SW。
这个帖子是针对TI-RTOS的training:
我们没有任何可用的TI-RTOS示例,这与我们对MSP430上的TI-RTOS的支持程度有关。