Friday, October 6, 2017

Embedded System

Q: What is char i = 0x80
A: 0x80 is a hexadecimal which is equal to 128

Terms for Serial IO:


  1. bit-banging: using software instead of hardware
  2. PISO: parallel in, serial out =/= SIPO: serial in parallel out
  3. asynchronous: independent clock, 2 ways communication, does not need to get response before sending
  4. synchronous: dependent on clock. Contrast to asyn
  5. MSB: most significant bit
  6. LSB: less significant bit
  7. USART: Universal synchronous/asynchronous receiver transmitter 
  8. linefeed: moving one line forward \n
  9. carriage return: moving the cursor to the beginning of line \r
  10. https://learn.sparkfun.com/tutorials/serial-communication
  11. https://hekilledmywire.wordpress.com/2011/02/23/direct-port-manipulation-using-the-digital-ports-tutorial-part-3/
  12. http://www.avr-tutorials.com/digital/about-avr-8-bit-microcontrollers-digital-io-ports
  13. https://embedjournal.com/interface-4x4-matrix-keypad-with-microcontroller/
  14. http://what-when-how.com/8051-microcontroller/keyboard-interfacing/
  15. https://hekilledmywire.wordpress.com/2011/02/23/direct-port-manipulation-using-the-digital-ports-tutorial-part-3/
  16. Timer in AVR: http://maxembedded.com/2011/06/avr-timers-timer0/
  17. read 110, and 107
  18. https://sites.google.com/site/qeewiki/books/avr-guide/pwm-on-the-atmega328
    - this site talks about duty cycles
    -
  19. http://maxembedded.com/2011/08/avr-timers-pwm-mode-part-i/
  20. http://maxembedded.com/2011/08/avr-timers-pwm-mode-part-ii/
  21. http://www.electroschematics.com/9846/avr-8-16-bit-timers-counters/

PRESCALER
a motor get hot when PWM is too fast
prescale setting how fast the timer count (default is 1 matching with the rate of the clk)
T0: PIN D4
T1: D5
PWM has 3 modes:
1. Fast PWM mode:
- work as normal counter
- Signal -> control logic -> TCNTn (Timer counter register) ++ -> match? -> OCFnx

PIC, 8085 , AVR, 32 Bit ARM7
TM4C1294NCPDT

FPGA


#include <avr/io.h>
int main(void){
//initialize the port for the LEDs
DDRB
PORTB
TCCR1B  |= 1<<CS10
while(1){
if (T
}
}

timer: http://maxembedded.com/2011/06/introduction-to-avr-timers/