3.16 Week8 Note
This week is about Embedded Programming.
Microprocessor / Microcontroller
- memory: registers, SRAM, DRAM, EEPROM, FLASH, fuse
- peripherals: A/D, comparator, D/A, timer/counter/PWM, USART, USB
- word size: 8, 16, 32, 64
- families: 8051, PIC, MSP, AVR (what we going to use), ARM STM32 mbed, PSoC xCORE Propeller
- vendors: Octopart, Digi-Key, Mouser, Newark, Farnell, SparkFun, Adafruit
- clocks
- types:
- RC (10%, 1% calibrated 校准)
- ceramic 陶瓷 (0.5%)
- quartz (50 ppm)
- PLL
- instruction cycles
- overclocking
- types:
Development
- in-system development (load a program into the processor)
- ISP (header, pads, clip) the program talk to the programmer
- bootloader: Arduino, DFU, Micronucleus
- JTAG, PDI
- ICE
- ISP (header, pads, clip) the program talk to the programmer
- programmers
- assembly language 汇编语言: hex file, instruction set, opcodes, mnemonics, directives, expressions, avr-as, gavrasm
- C (arduino underlying language): need a Compiler(编译器)to turn C language into hex codes.
- AVR is designed with GCC(the GNU Compiler Collection) in mind. AVR Libc are the bindings for C to talk to AVRs
- For OS X, use CrossPack for AVR® Development
- In a word, we are going to use UCC to compile C code to hex code for AVRs.
- IDE
- write, complie, load
- Atmel Studio, Eclipse, AVR, CodeBender
- Interpreters(but too slow): Python, BASIC, FORTH, AVRSH, Javascript(Espruino, Tessel, iop.io)
Communication(主机通讯)
- access for the serial port like pyserial
FTDI: offering a wide range of products including modules, cables, and integrated circuits for USB connectivity, super bridging MCUs and display systems.
Boards
AVR
-
-
- board + C libraries + IDE + bootloader + header
- hello.arduino.328P.cad
- XMEGA: newer family of AVR
- features
- toolchain: CrossPack for OS X
-
ARM
- ARM is a processor architechture which dominate in cellphone
- STM32
-
- PandaBoard
- Snappy
- PSoC: a programable system on chip, windows only