28335芯片main函数5部走,GPIO配置例子

该博客主要介绍了TI 28335芯片在开发过程中main函数的5个步骤,包括系统初始化、GPIO配置、中断处理等。通过举例说明了如何设置GPIO到默认状态,以及点亮LED作为入门实例。读者可以学习并直接应用这些步骤到自己的项目中。

随便打开一个TI的例子(controlSUITE软件),在它的main函数里都可以看到以下5部:直接copy

// Step 1. Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the DSP2833x_SysCtrl.c file.
   InitSysCtrl();
系统初始化,上两篇文章已经说过了

// Step 2. Initialize GPIO:
// This example function is found in the DSP2833x_Gpio.c file and
// illustrates how to set the GPIO to it's default state.
   // InitGpio(); Skipped for this example
对要用到的管脚进行配置,在GPIO例子中,直接跳过,但是在main函数后边对管脚进行配置。一般最简单的例子是就是点亮LED就会了

// Step 3. Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
   DINT;
汇编语言,清中断

// Initialize PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags
// are cleared.
// This function is found in the DSP2833x_PieCtrl.c file.
   InitPieCtrl();
初始化PIE向量,以后研究

// Disable CPU interrupts and clear all

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值