====== IE-0107 Laboratorio de Microcontroladores ====== ===== Proyectos ===== [[teaching:ie0107:ie-0107_laboratorio_de_microcontroladores_proyectos|Proyectos finales]] ===== Carta al estudiante ===== {{:ie0107:ie0107_carta_estudiante_ii-2012.pdf|ie-0107}} ===== Labo 1 ===== Circuito básico con el Atmega16. Bajar {{:ie0107:lab_micros_circuito_inicial.pdf|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 - 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 - Estas instrucciones van más al grano: http://www.joakimlinde.se/microcontrollers/atmega128/ ===== Puerto serial ===== - Niveles de voltaje - Rx, Tx ===== Temas de C ===== - int main(int argc, char** argv, char** env) - for if while - printf - hello, world - getchar, putchar - ++n; - Comparaciones == != >= <= - arrays int narray[10]; - call by value (arguments are copied) (local copy) (local copy can be modified) - character arrays char string[size]; - local variables (functions), extern and global variables - types and sizes (int, char, float, double) (short, long) (signed, unsigned) - declarations, definitions (vars funcs) - const (don't change) - + - / * aritmetica - casting - ++n n++ - bitwise | & ^ << >> ~ - += assignment - precedence page 50 switch (Expt) { case const: statements default: state } - do while - break, continue - functions return - header files .h - static: for external variables makes them unaccesible from users, for local variables, makes them permanent for functions - initialization int x=1; - #include, #define (preprocessor) - pointers, arrays - & address - * to declare pointes, and to resolve pointer data. - pointers and function arguments - structs - 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