成功构建项目后(在 VisualDSP 中),可执行代码成功加载到 blackfin 处理器 BF527,但 LED 不闪烁。我正在使用 JTAG 与 PC 通信板(包含 BF527 处理器)。给电路板加电后,每个 LED 的颜色都是半红半绿。我犯错了吗?
/* VisualDSP++ 5.1.2 Code to Blink LED on ADSP-BF527*/
#include <ccblkfn.h>
#include <cdefBF527.h>
#include <defBF527.h>
#include <stdio.h>
void Init_PLL(unsigned int msel, unsigned int ssel);
void Init_Leds(void);
void Delay(int);
int main( void )
{
Init_PLL(16,5);
Init_Leds();
while(1)
{
Delay(20000000);
*pPORTFIO_SET |= PF8; /*Enable the pin*/
Delay(20000000);
*pPORTGIO_SET |= PG11;
Delay(20000000);
*pPORTGIO_SET |= PG12;
Delay(20000000);
*pPORTFIO_CLEAR |= (PF8);
*pPORTGIO_CLEAR |= (PG11 | PG12);
}
}
void Init_Leds()
{
*pPORTF_FER &= ~(PF8);
*pPORTG_FER &= ~(PG11 | PG12);
*pPORTFIO_DIR |= (PF8);
*pPORTGIO_DIR |= (PG11 | PG12);
*pPORTFIO_CLEAR |= (PF8);
*pPORTGIO_CLEAR |= (PG11 | PG12);
}
void Delay(int n)
{
while(n--);
}