keil

How to create a delay function in Keil uVision?

∥☆過路亽.° 提交于 2019-12-07 15:09:52
问题 Arduino have a delay(ms) function to pause the program for certain amount of time. It is very accurate in millisecond. I have a delay function in C used in Keil uVision for AT89C5131 microp: void delay( unsigned long duration) { while ( ( duration -- )!= 0); } This does some delay job but the long value is not accurate like Arduino. Is there a way to create a function that works like delay() function in Arduino? The crystal is running at 24Mhz. Any help will be appreciated. 回答1: If you want

使用keil SDK方式点亮mini2440的led灯

青春壹個敷衍的年華 提交于 2019-12-06 06:13:04
最近在使用mini2440做开发,网上很多教程和实际操作不太一致,导致入门花费时间长。经过整理,目前mini2440点亮led灯方法有,keil mdk,linux环境编译,使用minitools下载即可。 mini2440分为nor flash和nand flash两种,一般小于4k程序可以直接运行,大于4K的程序需要预先加载引导程序,从存储位置拷贝至内存中。下面来说说mini2440究竟是如何点亮led灯的。 方法一:使用keil mdk的方式,首先下载MDK,使keil包含s3c2440这款芯片。根据该芯片创建工程,添加S3C2440.S文件。工程创建完成后,编写led.c文件代码如下 #define rGPBCON (*(volatile unsigned long *)0x56000010) #define rGPBDAT (*(volatile unsigned long *)0x56000014) #define rGPBUP (*(volatile unsigned long *)0x56000018) #define GPB5_IN ~(3<<10) #define GPB6_IN ~(3<<12) #define GPB7_IN ~(3<<14) #define GPB8_IN ~(3<<16) #define GPB5_OUT (1<<10) #define

How to create a delay function in Keil uVision?

会有一股神秘感。 提交于 2019-12-06 04:05:25
Arduino have a delay(ms) function to pause the program for certain amount of time. It is very accurate in millisecond. I have a delay function in C used in Keil uVision for AT89C5131 microp: void delay( unsigned long duration) { while ( ( duration -- )!= 0); } This does some delay job but the long value is not accurate like Arduino. Is there a way to create a function that works like delay() function in Arduino? The crystal is running at 24Mhz. Any help will be appreciated. If you want to do busy wait, this is how it's done in Keil: #pragma O0 void wait(volatile uint32_t cnt) { while(cnt--)

error: L6236E: No section matches selector - no section to be FIRST/LAST

十年热恋 提交于 2019-12-05 10:58:55
I'm new to ARM programming using Keil Microvision V5.12 compiler. I can't compile a simple assembly project getting this error: .\Objects\learn.sct(7): error: L6236E: No section matches selector - no section to be FIRST/LAST. I've tried searching and couldn't find any solution for this problem. This is what I do: Create a project ( without the startup file) Add a new assembly file (learn.s) Click Build Target . Can anybody help? There is no 'FIRST' object in your source code. Your scatter file likely looks something like: LR_IROM1 0x08000000 0x00040000 { ; load region size_region ER_IROM1

keil c51 不能使用:Go to Definition of....的解决方法

你离开我真会死。 提交于 2019-12-04 23:31:39
keil c51 不能使用:Go to Definition of....的解决方法 最近使用keil c51 开发usb固件,当向vc一样使用Go to Definition of....时,出现警告对话框: no browse information available in'工程目录' check-[target-options][output][browse information] then rebuild the target! 查了一些资料,原因大概有二: 1、代码中嵌有汇编,汇编代码去掉后能查看。 2、选中target1,然后点击右键,选择 option for target 'target1' ,在弹出的对话框中选择output选项卡,看Browse information 选项有没有勾选,如果没有,请勾选,然后把你的工程rebuild 一次。 来源: CSDN 作者: yam_killer 链接: https://blog.csdn.net/yam_killer/article/details/7673191

How to compare and swap atomically in ARM7?

回眸只為那壹抹淺笑 提交于 2019-12-04 19:23:42
I would like to modify a global variable which is shared by different tasks and IRQ contexts in a RTOS. Therefore I need to modify this variable atomically. In my current implementation, I have been using enable_irq/disable_irq functions to modify the statement atomically. extern int g_var; void set_bit_atomic(int mask) { disable_irq(); g_var |= mask; enable_irq(); } I've found the __sync_bool_compare_and_swap function in GCC documentation as a helper for atomic operations. My current toolchain is KEIL MDK, and I would like to switch to the approach shown below, void set_bit_atomic(int mask) {

Undefined symbol SystemInit(referred from startup_stm32f2xx.o) while building using Keil STM32

拟墨画扇 提交于 2019-12-04 19:19:46
I am using STM32F207VC controller. and I am using uvision4 IDE, When I try to compile a simple code, I get the error tst1.axf: Error: L6218E: Undefined symbol SystemInit (referred from startup_stm32f2xx.o). . I have place stm32f2x file to my project directory. But still the same problem. Please help in resolving this. Thanks aGuegu "Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\system_stm32f10x.c" is needed it be added, as SystemInit() is defined within it. Well, you should define (or take it from somewhere) function SystemInit, since it is called from startup.s file. Or you can comment lines

keil,调试告警 This target device does not support all the defined breakpoints! Please reduce the number of breakpoints and start again.

Deadly 提交于 2019-12-03 22:32:54
keil调试的时候告警This target device does not support all the defined breakpoints! Please reduce the number of breakpoints and start again. “此目标设备不支持所有定义的断点请减少断点数并重新启动。” 意思是断点太多了,经过检测断点超过5个就会出现这种问题 解决方案: 继续开启调试模式,弹出告警框之后,点击确定,去掉告警框,然后再用快捷键(Ctrl+B),打开breakpoints ,能够看到所有的断点,可以选择将所有的断点去掉(kill all)或者去掉部分断点(kill selected),勾选read和write前面单选框,关闭当前弹出框,就能解决问题了。 一.开启调试,点击确定,去除Error 二. Ctrl+B, 打开Breakpoints 三. 去除断点,勾选read和write,关闭 来源: https://www.cnblogs.com/ys77/p/11809860.html

Keil软件的使用入门教程

我与影子孤独终老i 提交于 2019-12-03 22:32:53
keil软件使用具体教程 烧录软件使用 IAR工程模板的创建 1.打开keil软件后,创建一个工程,即点击【文件】—【新建】—【新建工程】。 2.建议先新建一个文件夹用来存放工程,在输入工程名后点【保存】。 3.出现单片机型号选择框,产品使用的是STC89C52,由于上面没有stc的,选择Atmel的就可以,因为它们都是51内核,程序都是兼容的,在这选择AT89C51/AT89C52都可以,选好后点击【确定】 4.出现一个选择是否的对话框,这里选择【否】 5.现在可以新建c程序了,点击 【新建一个新文件】后点左上角的 保存按钮,输入文件名,记住扩展名.c。 6.接着点击【目标1】,右键【源代码组1】,出现可以选择。点击【添加文件到组‘源代码组1’】 ,选择刚才的c文件,点击【add】后点【close】。 7.现在【源代码组1】中就已经添加的c文件,可以进行编程了。但由于要烧录到单片机中,还得创建hex文件。在上面方框【目标1】的右边的第一个按钮,单击。选择【输出】,勾选【产生HEX文件】就可以了。 Keil软件的使用具体教程: 注意:HEX文件后提供给另一烧录软件使用,烧录到板子上。 步骤如下: 总 结:资料总汇下载及视频图文学习资料 点 击 这 里 ------------------------------------------------------------------