Article Directory
4. Introduction to IAR Integrated Development Environment
A complete and stable professional embedded development environment, with a unified user interface for different processors, supporting more than 35 MCUs, including 8, 16, and 32 bits, fully
compatible with C language and
efficient floating-point support,
IAR main interface:
Create an empty project test, create an empty file main.c, add it to test:
modify main.c:
#include <ioCC2540.h>
#define BV(n) (1<<(n))
void delay(unsigned int time)
{
int i,j;
for (i = 0;i <= time;i++)
for (j = 0;j <= 1000;j++);
}
int main()
{
//端口的配置,设置P1.0为输出
P1DIR |= BV(0);
//设置端口为GPIO
P1SEL &= ~BV(0);
while(1)
{
P1_0 = 1;
delay(1000);
P1_0 = 0;
delay(1000);
}
}
Set options: target selection: Texas Instruments->CC2540F256.i51
link check: Override default
debugger driver selection: Texas Instruments
save as test1, compile, prompt:
Building configuration: test - Debug
Updating build tree...
main.c
Linking
Total number of errors: 0
Total number of warnings: 0
Click the simulation next to make (you need to install the driver in advance):
here set the debugger to simulate, software simulation.
5. cc254 core board hardware resources
Onboard resources
Balun antenna matching Crystal
oscillator (2)
power supply circuit
Lithium battery power supply
LED
oled
Serial port circuit