gpt4 book ai didi

c - 加载代码后 LED 不闪烁 Blackfin 处理器 F527

转载 作者:太空宇宙 更新时间:2023-11-04 07:58:00 25 4
gpt4 key购买 nike

<分区>

成功构建项目(在 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--);
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com