IE-0107 Laboratorio de Microcontroladores

Proyectos

Carta al estudiante

Labo 1

Circuito básico con el Atmega16. Bajar aquí

Conexión para el puerto paralelo:

Connect AVR with parallel port
      AVR                       Parallel Port
 Signal name   Pin             Pin  Signal name
 GND           20 ------------ 19   GND
 GND           20 ------------ 21   GND
 SCK            8 ------------  1   Strobe
 MOSI           6 ------------  2   Data 0
 MISO           7 ------------ 11   Busy
 Reset          9 ------------ 16   Init

Comandos para programación:

uisp -dprog=dapa -v -dlpt=0x378 --erase
uisp -dprog=dapa -v -dlpt=0x378 --upload  if=prueba001adc.hex
  1. Algunas instrucciones generales:

http://www.cs.tut.fi/kurssit/OHJ-4300/public_html_8104150/harjtyo/linux_auto/documentation/tools.html
http://www.raphnet.net/divers/avrprog/index_en.php

  1. Estas instrucciones van más al grano:

http://www.joakimlinde.se/microcontrollers/atmega128/

Puerto serial

  1. Niveles de voltaje
  2. Rx, Tx

Temas de C

  1. int main(int argc, char argv, char env)
  2. for if while
  3. printf
  4. hello, world
  5. getchar, putchar
  6. ++n;
  7. Comparaciones == != >= ⇐
  8. arrays int narray[10];
  9. call by value (arguments are copied) (local copy) (local copy can be modified)
  10. character arrays char string[size];
  11. local variables (functions), extern and global variables
  12. types and sizes (int, char, float, double) (short, long) (signed, unsigned)
  13. declarations, definitions (vars funcs)
  14. const (don't change)
  15. + - / * aritmetica
  16. casting
  17. ++n n++
  18. bitwise | & ^ « » ~
  19. += assignment
  20. precedence page 50
switch (Expt) {
   case const: statements
   default: state
   }
  1. do while
  2. break, continue
  3. functions return
  4. header files .h
  5. static: for external variables makes them unaccesible from users, for local variables, makes them permanent for functions
  6. initialization int x=1;
  7. #include, #define (preprocessor)
  8. pointers, arrays
  9. & address
  10. * to declare pointes, and to resolve pointer data.
  11. pointers and function arguments
  12. structs
  13. typedef int length;
struct point {
  int x;
  int y;
};
struct point pt;
  • sscanf

Referencias para C

Como compilar programas en linux: http://www.linuxquestions.org/linux/answers/Programming/Building_C_programs_on_Linux

Que pasa cuando uno ejecuta programas en linux: http://linuxgazette.net/issue84/hawk.html

  • teaching/ie0107/ie-0107_laboratorio_de_microcontroladores.txt
  • Last modified: 2016/02/26 11:15
  • by amora