没有合适的资源?快使用搜索试试~ 我知道了~
首页C语言入门:嵌入式系统开发指南
"《First Steps with Embedded Systems》是一本专为想要深入了解嵌入式系统编程,特别是使用C语言的中级程序员设计的指南。本书旨在填补市场上的空白,为后继的中高级技术教育提供入门课程,同时帮助开发者适应微控制器行业快速发展的需求。 该书内容覆盖了微控制器编程的基础知识,例如如何使用C语言编写程序,特别是与C结合使用汇编语言的方法。作者强调,所有ByteCraft编译器都遵循ANSI标准,这意味着它们在目标硬件限制内可以提供兼容性。对于代码效率,编译器生成的机器码紧密且高效,通常能与大部分手工编写的汇编代码相媲美。 在混合编程方面,读者可以将汇编代码嵌入到C程序中,通过使用`#asm`和`#end`预处理指令。这样做的好处是可以让嵌入的汇编代码调用C函数并访问C变量,为了方便传递参数,建议将汇编代码放置在C函数体内部。 此外,书中还提及了编译器对本地变量声明的支持。ByteCraft编译器将局部变量存储在可重用的局部内存空间中,确保了高效的内存管理。然而,关于特定类型的模拟器硬件支持,读者需要直接联系ByteCraft Limited的技术支持团队获取详细信息,以获得最准确的产品兼容性和功能列表。 《First Steps with Embedded Systems》为学习者提供了一个坚实的基础,不仅教授了C语言编程技巧,还教会了如何巧妙地利用汇编语言进行优化,并介绍了如何与硬件交互。无论是初学者还是经验丰富的开发人员,都能从中获益匪浅,应对日益变化的嵌入式系统开发挑战。"
资源详情
资源推荐
Table of Examples
xii
Example 35: Using the equality operator in control structures ............................................92
Example 36: The inequality operator........................................................................................92
Example 37: Logical NOT and AND operators ....................................................................93
Example 38: Using the or operator...........................................................................................94
Example 39: Sort circuit expression evaluation ......................................................................94
Example 40: Using short-circuit evaluation.............................................................................94
Example 41: Bitwise AND operation using &........................................................................95
Example 42: Using the AND bitwise operator with binary values......................................96
Example 43: Using the bitwise OR operator | .......................................................................96
Example 44: The bitwise XOR operator .................................................................................96
Example 45: The bitwise NOT operator .................................................................................97
Example 46: Shifting bits left and right....................................................................................97
Example 47: Controlling loops without using logical operators ....................................... 100
Example 48: if and else structure ........................................................................................... 100
Example 49: Using the if statement structure ...................................................................... 100
Example 50: The else statement............................................................................................. 101
Example 51: Nesting if statements......................................................................................... 101
Example 52: Converting nested if statements to logical expressions ............................... 102
Example 53: Matching if and else statements ...................................................................... 102
Example 54: Using braces to clarify the combination of if and else................................. 102
Example 55: An alternate format for showing if else pairing ............................................ 103
Example 56: The switch..case structure ................................................................................ 103
Example 57: Using the fall-through effect with switch statements................................... 104
Example 58: Multiple case enhancement.............................................................................. 105
Example 59: Using the default case value............................................................................. 105
Example 60: The goto statement ........................................................................................... 106
Example 61: The while loop syntax....................................................................................... 107
Example 62: The do loop syntax............................................................................................ 107
Example 63: Comparing the while and for loops................................................................ 108
Example 64: Using the for loop ............................................................................................. 108
Example 65: Comparing function and variable declarations ............................................. 114
Example 66: The function statement block.......................................................................... 116
Example 67: Variable declarations inside functions............................................................ 116
Example 68: Passing data to a function by value................................................................. 117
Example 69: Passing a variable to a function by address (reference) ............................... 118
Example 70: Using the address of operator.......................................................................... 122
Example 71: Using the pointer dereference operator ......................................................... 123
Table of Examples
xiii
Example 72: Dereferencing a pointer set to NULL.............................................................123
Example 73: Initializing a pointer...........................................................................................124
Example 74: Array operations and pointer arithmetic.........................................................125
Example 75: The relationship between arrays and pointers ...............................................126
Example 76: Declaring and initializing an array of pointers ...............................................127
Example 77: Using typedef to define a new data type.........................................................127
Example 78: Defining a new enumerated type .....................................................................128
Example 79: Declaring multiple variables of the same enumerated type .........................129
Example 80: Enumerated types as integer values.................................................................129
Example 81: Testing the value of an enumerated type........................................................129
Example 82: Specifying integer values for enumerated elements ......................................130
Example 83: Specifying a starting value for enumerated elements....................................130
Example 84: The assignment of integer values to an enumerated list...............................130
Example 85: Declaring the template of a structure..............................................................131
Example 86: Declaring a structure without a tag..................................................................131
Example 87: Using typedef to clarify structure declaration ................................................132
Example 88: Accessing elements in a structure ....................................................................132
Example 89: A structure accessed with a pointer.................................................................133
Example 90: Bit fields in structures........................................................................................134
Example 91: Accessing bit fields.............................................................................................134
Example 92: Compiler dependant storage of bit fields .......................................................134
Example 93: Declaring a union ...............................................................................................135
Example 94: Using typedef to declare a union .....................................................................135
Example 95: Using a union to create a scratch pad .............................................................136
Example 96: Using a union to access data as different types..............................................136
Example 97: Accessing a union element with the dot operator.........................................136
Example 98: Using the right arrow operator to access a union member..........................136
Example 99: Returning the low Byte of a word....................................................................137
Example 100: Returning a specific part of a word for little endian ...................................137
Example 101: Incompatible variables with different storage methods in unions............138
Example 102: Restricting a function’s scope by declaring it as extern..............................141
Example 103: Using preprocessor directives to declare extern global variables..............142
Example 104: Using the static data modifier to restrict the scope of variables ...............142
Example 105: Using static variables to track function depth..............................................143
Example 106: Using the register data type modifier ............................................................143
Example 107: Using the auto data modifier..........................................................................144
Example 108: The far pointer type as default .......................................................................149
Table of Examples
xiv
Example 109: Nesting preprocessor directives .................................................................... 151
Example 110: Redefining a constant using #undef............................................................. 155
Example 111: Defining and calling a macro......................................................................... 156
Example 112: Using #if and #endif to conditionally compiler code............................... 157
Example 113: Using expressions in #if directives for conditional compilation ............. 158
Example 114: Using the defined() function for conditional compilation ........................ 158
Example 115: Using !defined() to test if a symbol has not been defined......................... 158
Example 116: Using #else and #elif to choose between compilation blocks................. 159
Example 117: Using #elif, #if and #endif for conditional compilation.......................... 159
Example 118: Using #ifdef and #ifndef............................................................................... 159
Example 119: Using the #error directive.............................................................................. 160
Example 120: Master function for PIC16C74 SPI communication ................................. 163
Example 121: Setting up the SPI on the Microchip PIC16C74 ........................................ 165
Example 122: Setting up SPI on the Motorola 68HC705C8 ............................................. 165
Example 123: Setting up SPI on the National COP8SAA7............................................... 166
Example 124: Initiating SPI send/receive on the Microchip PIC16C74......................... 167
Example 125: Initiating SPI send/receive on the Motorola 68HC705C8 ....................... 167
Example 126: Initiating SPI send/receive on the National COP8SAA7......................... 168
Example 127: Serial port connection example for the PIC16C74 .................................... 180
Example 128: Serial port connection example for the PC ................................................. 182
xv
Table of Figures
Figure 1: The microcontroller......................................................................................................7
Figure 2: Von Neumann memory map for the MC68705C8 .................................................9
Figure 3: Harvard memory map PIC16C74 ............................................................................10
Figure 4: Harvard memory map COP8SAA7 .........................................................................11
Figure 5: Instruction clocking on the PIC16C54....................................................................12
Figure 6: The CPU ......................................................................................................................13
Figure 7: MC68HC705C8 stack ................................................................................................15
Figure 8: Saving the machine state on the MC68HC705C8 .................................................33
Figure 9: Data storage VS. data value.......................................................................................45
Figure 10: RS-232 signal ...........................................................................................................170
Figure 11: Project schematic....................................................................................................182
剩余227页未读,继续阅读
williezyt
- 粉丝: 6
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 构建Cadence PSpice仿真模型库教程
- VMware 10.0安装指南:步骤详解与网络、文件共享解决方案
- 中国互联网20周年必读:影响行业的100本经典书籍
- SQL Server 2000 Analysis Services的经典MDX查询示例
- VC6.0 MFC操作Excel教程:亲测Win7下的应用与保存技巧
- 使用Python NetworkX处理网络图
- 科技驱动:计算机控制技术的革新与应用
- MF-1型机器人硬件与robobasic编程详解
- ADC性能指标解析:超越位数、SNR和谐波
- 通用示波器改造为逻辑分析仪:0-1字符显示与电路设计
- C++实现TCP控制台客户端
- SOA架构下ESB在卷烟厂的信息整合与决策支持
- 三维人脸识别:技术进展与应用解析
- 单张人脸图像的眼镜边框自动去除方法
- C语言绘制图形:余弦曲线与正弦函数示例
- Matlab 文件操作入门:fopen、fclose、fprintf、fscanf 等函数使用详解
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功