[DemoCode下载] N76E003支持使用 SDCC

[复制链接]
1011|1
 楼主| dongnanxibei 发表于 2024-6-23 20:44 | 显示全部楼层 |阅读模式
4329466781889070aa.png
N76E003-master.zip (987.9 KB, 下载次数: 0)
  1. /*---------------------------------------------------------------------------------------------------------*/
  2. /* SDCC simple "Hello World" UART0 for Nuvoton N76E003                                                     */
  3. /* Just connect any serial adapter on N76 ports P.06 and P.07 and view the result in PC serial monitor     */
  4. /* P0.6 [TX] -> FTDI [RX]                                                                                  */
  5. /* P0.7 [RX] <- FTDI [TX]                                                                                  */
  6. /* Adapted from Nuvoton's UART0_Printf sample code                                                         */
  7. /*---------------------------------------------------------------------------------------------------------*/

  8. #include "N76E003.h"
  9. #include "SFR_Macro.h"
  10. #include "Function_define.h"
  11. #include "Common.h"
  12. #include "Delay.h"

  13. /* Needed for printf */
  14. int putchar (int c) {
  15.   while (!TI);
  16.   TI = 0;
  17.   SBUF = c;
  18.   return c;
  19. }


  20. /*==========================================================================*/
  21. void main (void)
  22. {
  23.           InitialUART0_Timer3(115200);
  24.           TI = 1;                                                                                                                        // Important, use prinft function must set TI=1;
  25.        
  26.                 while(1)
  27.                 {
  28.                         printf_small("\n Hello world");
  29.                         Timer0_Delay1ms(300);
  30.                 }
  31. }


zhuomuniao110 发表于 2024-6-23 22:12 | 显示全部楼层
这好像是一个免费的编译器。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

225

主题

3870

帖子

18

粉丝
快速回复 在线客服 返回列表 返回顶部