从头开始用 C 语言编程 ARM
我有一个来自嵌入式艺术家的 LPC3141 开发人员套件,并且我已经成功创建了基于 eclipse 的免费 IDE,可以成功为 ARM 进行编译。我使用附带的信号灯示例测试了我的 IDE。我有一个启动代码和一个可以工作的链接器脚本,从现在开始我将使用它们。
现在我想学习如何从无到有开始我自己的眨眼程序。我首先要编程什么?是 GPIO 寄存器、定时器寄存器、uart 寄存器……???第一件事是什么?我需要写的东西实际上是 HAL 吗?我已经订购了这本书书,什么你认为吗?
谢谢。
问候 齐加
I have a LPC3141 developers kit from Embeded artists and i have sucessfully created free IDE based on eclipse that can sucesfully compile for ARM. I tested my IDE using included blinker example. I have a startup code and a linker script which work and i will use them from now on.
Now i would like to learn how to start my own blinker program from nothing. What do i have to program first? Is it GPIO registers, timer registers, uart registers,... ??? What is the very first thing? Is the thing i need to write in fact a HAL? I allready ordered this book, what do you think?
Thank you.
Regards Ziga
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这些页面可能有用,同一系列,不同的芯片。
http://lpcstuff.blogspot.com/2008/09/lpc -2148-blinker-1.html
http://lpcstuff.blogspot.com/2010 /08/nxp-mbed-aint-so-bad-after-all.html
您不需要计时器或中断或类似的东西来开始。有一个(长)while 的 C 循环计数,然后更改 GPIO 的状态。您需要将 GPIO 配置为输出。并小心不要让 C 编译器优化您的延迟循环。稍后您可以开始轮询计时器,然后如果您认为确实需要,则可以中断。
These pages might be useful, same family, different chips.
http://lpcstuff.blogspot.com/2008/09/lpc-2148-blinker-1.html
http://lpcstuff.blogspot.com/2010/08/nxp-mbed-aint-so-bad-after-all.html
You wont need timers or interrupts or anything like that to get started. have a C loop count for a (long) while then change the state of the gpio. You will need to configure the gpio as an output. And careful not to have the C compiler optimize out your delay loop. Later you can get into polling the timer, then after that interrupts if you feel you really need to.
开始使用 Arm 微控制器非常容易。您所需要做的就是阅读微控制器的数据表和用户手册。您可以在用户手册中找到有关外设和寄存器的所有文档
https:/ /www.nxp.com/docs/en/user-guide/UM10362.pdf ,此代码适用于lpc2148():
例如
it is really easy to get started with arm microcontrollers. all you need to do is reading the datasheet and user manual of your microcontroller. you can find all documentation about peripherals and registers in the user manual
https://www.nxp.com/docs/en/user-guide/UM10362.pdf
for example, this code is for lpc2148 ():