Home
Excitador La vaca Manual de usuario
Contents
1. BV PBO PORTB amp _BV PBO PINES_CONTROL amp Ox0f lt lt PCIZQ PC DDR Ox0f lt lt PCIZQ J void init_dipsw activar pull ups para el dipswitch SFIOR amp _BV PUD DDRC 0 PORTC Oxff PINC Oxff J void init_adc DDRA 0 PORTA 0 ADMUX ADCREF ADCSRA ADCPRE una conversion para tirar 23 SE 2011 La kehuelga radio ADCSRA _BV ADSC i void init timers t DDRB BV PB3 DDRD BV PD7 PORTB BV PB3 PORTD BV PD7 TCCR1A 0x0 TCCR1B 0x01 TCCR2 0x61 TCCRO 0x69 TIMSK 0x40 cambia a 0x60 para habilitar capture de timer1 uint8_t leer_dipsw return PINC ISR BADISR_vect el timer2 genera el pwm para controlar la frecuencia ISR TIMER2 OVF vect 1 funinter UART rcp if UCSRA amp 1 lt lt RXC brx UDR pwmsema int main 1 inicializaci n de los perif ricos init pines 24 SE 2011 La kehuelga radio init adc init dipsw init timers init UART scaner de los comandos que llegan por el puerto serial init scaner modo inicial modo pll sei while 1 1 leer cmds envia UART kfunmain d return 0 4 6 vaca h Copyright 2010 la kehuelga radio This program is free software you can redistribute it and or modify qit under the terms of the GNU General Public L
2. La kehuelga radio de ningun modo DIS SAVE u Opciones de Ragel RAGEL OPCIONES C G1 Opciones comunes a las reglas para compilar ligar y ensamblar COMMON mmcu MCU Opciones de compilaci n CFLAGS COMMON CFLAGS Wall pedantic g 03 funsigned char funsigned bitfields fpack struct fshort enums CFLAGS Wp M MP MT F o MF dep F d Banderas del ensamblador ASMFLAGS COMMON ASMFLAGS x assembler with cpp Wa gdwarf2 Banderas del linker LDFLAGS COMMON LDFLAGS lm Banderas para producir un archivo Intel Hex HEX_FLASH_FLAGS R eeprom HEX_EEPROM_FLAGS j eeprom HEX EEPROM FLAGS set section flags eeprom alloc load HEX EEPROM FLAGS change section lma eeprom 0 INCLUDES I usr avr include Objetos necesarios para ligar OBJECTS vaca o serial o modos o H all TARGET vaca hex vaca eep boot MAKE C DIRBOOT programar all avrdude DIS SAVE p MCU P PORT c PROGRAMMER b BAUD v U flash w HEXFILE U eeprom w EEPROMFILE Compilar 28 GOLO 2011 La kehuelga radio vaca o Vaca C CC INCLUDES CFLAGS c lt o 0 modos o modos c CC INCLUDES CFLAGS c lt o serial o serial c CC INCLUDES CFLAGS 00 c lt o 0 Ragel serial c serial rl ragel RAGEL_OPCIONES lt Ligar TARGET OBJECTS CC LDFLAGS OBJECTS LIBDIR
3. La frecuencia de inicio se lee del IFS dipswitch RF Restaura la frecuencia desde la EE RFiiii ERROR Frec INVALIDA PROM IFM La frecuencia de inicio se lee de la IFM EEPROM IF Reporta la fuente de la frecuencia de IFM IFS inicio S Reporta el dipswitch Shh P 0 3 01 Cambia el valor de un pin de control P 0 3 01 P 0 3 Reporta el valor del pin de un con P 0 3 01 trol V 0 7 Reporta un canal del ADC conver V 0 7 hhh tidor anal gico digital 3 Diagramas 3 1 Esquem tico Gg sdoe s m E wo Ss 7 9 TL mo uer 3 en x ke 2 g mi E sayy 33 zx Ter T N v id poa oov vx ET 1037 s i aie viu SD 193 09d 019X 08d T o T i sn i ee vas Lod LD bad Pa del sebedy a Araure s z vd 0101 20d ONIV ZLND eau TE lt S uw
4. io h gt tinclude lt avr eeprom h gt tinclude avr interrupt h include lt util delay h gt include vaca h 14 SE 2011 La kehuelga radio include modos h para transmitir datos solo es necesaria la funci n printf char btx kbrx bufrx CARS BUFRX J char buftx CARS BUFTX La Vaca Muuuu r int8_t cs act hay 0 char ts te 0 p bufrx pe bufrx eof 0 uint8_t resadch resadcl bitc uint16 t argnum uint32_t argnum32 Ah machine cmds action err_cmd strcat buftx KE r main Cambiar la Amplitud Aa xdigit 2 O sscanf ts 1 02x amp argnum r gt amp uint8_t argnum OCRO amp sprintf buftx strlen buftx A O2X r amp F Reportar la Amplitud Aa 7 7 Nr gt sprintf buftx strlen buftx A 02X r amp Le Guardar la Amp en la EEPROM Gg Aa CAr gt 1 eeprom write byte tnvamp amp sprintf buftx strlen buftx GA402XXr amp a Restaurar la Amp de la EEPROM Rr Aa r gt d amp eeprom read byte nvamp 15 SE 2011 La kehuelga radio delay us 100 OCRO amp sprintf buftxtstrlen buftx RAZO2X r amp Ja t Amplitud de Inicio Memoria 4 si dipsw 47 1 cuando estado 1 la amplitud se inicia con el valor de la nvram Ii Aa Mm Ar gt eeprom_write_byte amp nvai M sprintf buftx strlen buftx IAM
5. o lt l AS E va SND Od ENIV 090 8d Y lt EI mr DP si D ii LI BS osy ru gu E vg OGL POJ Tss vad TE 2 s A g e ud erqwe 680 810 zeesu C u El 2 lia sod ison sad E z o A 4 os rea LOSOL 99d Osin 98d 4 uid eqweH 680 su 26284 lt r a i gt dra L E 67 ZOSO ZOJ 108 ad E Im EI muesbord ered sedu salamo i s uid EIqWoH 680 ONO 26284 fy FT Daul 004 osav ova DE 9 ausiaa ony o Li omg y ud esqwe 68a ya zezsy lt z Sen axi Lad toa iva ap TO Zorn inv N MEE gu e uid eiqweH 680 AXI zezsu lt guza nou a vans 180 vd Fa on zad zoav va e 2 s austaa znv z ud sien 680 axy 26284 lt ux Throw ven kar s aHsiga ed C 11 sad eoaw eva ap OO t astaq env oL ml pu ino pu er any z aHstadzd Fi 81190 rad boav vva FE OOD z1 aHs1aa pny 1 a Chat amb la So WaHsiaa id F i v100 sad Jeng sva po TD 1 aH919A SNY LE ja e 401 90d gw ava pre starte env M Db em sie AIS Te 200 0d ov va pe S1 0HS180 NV eo S s dHsigd ONDO 8 Tiit z riv SH 01 QHS1890 ONE an Seu anf Oydia zeebew1y 6 AHSIBQ Ast lt FI Ka an ai anr anr wer I e ano amo lL Lm Eo ii Se j se Sen GE mr JE A ki adoze H olpny M wo EH DIE vee 168 H Gei s19 bey eu say NE xa L X anr 602AN ap 18 wes w G t 220 vu LA sn oy SIH E mr BEN Se oe L SE E uo OEH DIE Di MEE puni oe e eu ozy siy a ID OTT et EN Div ad Por Ka L A Ee la mt ee wo Par viu SA
6. r L 4 Amplitud de Inicio cero 4 si dipsw 7 1 cuando estado 1 la amplitud no se prende sola Lii Aa CO AT gt eeprom_write_byte amp nvai 0x00 sprintf buftxtstrlen buftx IAO r t Reportar fuente de la amplitud de inicio Mi Aa C CEZ gt argnum eeprom read byte 4nvai sprintf buftxtstrlen buftx IA ic r argnum M 0 I 4 Cambiar la Frecuencia Ff digit 4 sscanf tst 1 404d int amp argnum r gt if argnum gt 879 EE argnum lt 1079 1 veces 0 estado 0 frec argnum ds calcds uinti6_t frec sprintf buftxtstrlen buftx F 04dNr frec L else 1 sprintf buftxtstrlen buftx ERROR Frec MALA r Reportar la Frecuencia C Ff C E r gt sprintf buftx strlen buftx F 04d r frec 16 SE 2011 La kehuelga radio J3 4 Guardar la frecuencia seleccionada en la EEPROM Gg Ff CNr gt d eeprom_write_word amp nvfrec frec sprintf buftxtstrlen buftx GF 04dNr frec L 4 Restaurar la frecuencia de la EEPROM Rr Ff 92 gt argnum eeprom read word nvfrec if argnum gt 879 amp amp argnum 1079 1 veces 0 estado 0 frec argnum ds calcds uint16 t frec sprintf buftxtstrlen buftx RF 04dNr frec L else 1 sprintf buftxtstrlen buftx ERROR Frec MALA Nr Es 4 Frecuencia de inic
7. 19 SE 2011 La kehuelga radio sei strcat buftx MD r Cambiar al modo pll Mm Pp Nr gt 1 cli modo pll sei strcat buftx MP r L sl F4 44 write data void init scaner d ts bufrx te 0 p bufrx pe bufrx eof 0 write init void init_UART UBRRH uint8_t BAUD gt gt 8 UBRRL uint8 t BAUD UCSRB 1 RXEN 1 TXEN UCSRC 1 URSEL 3 UCSZO brx bufrx btx buftx void envia_UART d UART TX x if kbtx 1 if UCSRA amp 1 lt lt UDRE 1 UDR btx 20 SE 2011 La kehuelga radio else 1 btx buftx btx 0 void bufrx_inicio uint8 t bipwmsema espera una interrupci n de captura bipwmsema pwmsema while pwmsema bipwmsema brx p pe bufrx void err_bufrx bufrx_inicio strcat buftx ERROR BUFRX LLENO r void leer_cmds uint8_t lcpwmsema int8_t espacio CARS BUFRX hay jhay algo nuevo if pe brx return error se ha llenado el bufrx if espacio 0 1 err_bufrx return espera la pr xima consulta del UART antes de cambiar el apuntador del bufrx lcpwmsema pwmsema while pwmsema lcpwmsema pe brx khwrite exec 21 SE 2011 La kehuelga radio if cs cmds error 1 strcat buftx KE r init scaner bufrx_inicio if ts 0 hay 0 bufrx inicio el
8. Excitador La vaca Manual de usuario ndice 1 Sin computadora 1 1 C mo seleccionar la frecuencia 2 1 C mo conectar a una computadora 3 Diagrama N N probar la comunicaci 00 G NON 740 E Tarta madig A ea k a E a a a a a ah EE 1 it 4 C digo Fuente 4 3 serial 00 0 Oo JI DO VW 4 4 serial r 4 7 Makefile SE 2011 La kehuelga radio El excitador puede ser configurado de dos maneras con 8 interruptores que estan soldados a la tarjeta y mediante un puerto de comunicaci n serial RS232 Con los interruptores solo es posible seleccionar la frecuencia de operacion mientras que con el puerto serial el excitador puede comunicar informacion referente a su funcionamiento como el estado de algunos contadores ademas de poder seleccionar la frecuencia y la potencia de salida 1 Sin computadora i no tienes disponible una computadora con puerto serial o simplemente no quieres usarla para configurar los par metros del excitador debes prender el interruptor n mero 8 del dipswitch entonces el aparato leer la frecuencia de los 7 interruptores restantes del mismo dipswitch y no de su memoria 1 1 C mo seleccionar la frecuencia Podemos considerar que los 7 interruptores definen un n mero binario el cual corresponde se cuencialmente a las frecuencias de operaci n que van de 87 9 MHz hasta 107 9 MHz Es decir al n mero binario 0000000 corresponde l
9. S LIBS o TARGET 4 hex TARGET avr objcopy O ihex HEX FLASH FLAGS lt 4 eep TARGET avr objcopy HEX EEPROM FLAGS O ihex lt 1ss TARGET avr objdump h S lt gt Clean target PHONY clean clean rm rf OBJECTS vaca elf serial c dep vaca hex vaca eep Otras dependencias include shell mkdir dep 2 gt dev null wildcard dep Soee 2011 Publicado por la kehuelga radio bajo la licencia Creative Commons Atribuci n No comercial Licenciamiento Reciproco 2 5 Disponible en http creativecommons org licenses by nc sa 2 5 mx 29
10. a frecuencia 87 9 MHz al n mero 0000001 la frecuencia 88 0 MHz y as sucesivamente hasta llegar a 107 9 MHz o sea 1100100 En lugar de contar desde O hasta el n mero que corresponde a la frecuencia que queremos configurar podemos usar la siguiente relaci n po E E 1 2 Donde f es la frecuencia en MHz y n es el n mero que hay que configurar en el dipswitch n esta en base decimal hace falta convertirlo a base binaria Digamos por ejemplo que queremos operar en la frecuencia de los 93 5 MHz Si aplicamos la relaci n 1 tenemos 93 5 x 10 879 9 28 28 en base binaria es 0011100 2 Con computadora 2 1 C mo conectar a una computadora y probar la comunicaci n El excitador cuenta con un puerto de comunicaci n serial que sigue el est ndar RS232 puedes conectarlo a un puerto serial de una computadora necesitar s un programa emulador de terminal que se pueda conectar a un puerto serie en GNU Linux puedes usar gtkterm adem s debes configurarlo con los siguientes par metros SE 2011 La kehuelga radio Velocidad Bits de datos Bits de paro Paridad Ninguna Prueba la comunicaci n por ejemplo preg ntale al excitador en qu frecuencia esta trabajando debes escribir en la terminal el comando f Para que el comando sea enviado al excitador debes oprimir la tecla enter despu s de escribir el comando Si la comunicaci n funciona correctamente el excitador responder con la frecue
11. esadcl ADCL resadch ADCH sprintf buftxtstrlen buftx V 1X7 01X 02XXr argnum resadch resadcl Le Cambiar el vco Pp Vv xdigit 8 Ofsscanf ts 2 081x kargnum32 r 1 espera la proxima consulta del UART antes de cambiar el apuntador del bufrx lcpwmsema pwmsema while pwmsema lcpwmsema vco argnum32 sprintf buftxtstrlen buftx PV O81XNr argnum32 18 SE 2011 La kehuelga radio jis Reportar el vco Pp Vv gt Ar espera la pr xima consulta del UART antes de cambiar el apuntador del bufrx lcpwmsema pwmsema while pwmsema lcpwmsema argnum32 vco sprintf buftxtstrlen buftx PV 081X r argnum32 Reportar el error Pp Ee Nr gt 1 espera la proxima consulta del UART antes de cambiar el apuntador del bufrx lcpwmsema pwmsema while pwmsema lcpwmsema argnum32 error sprintf buftx strlen buftx PE 081XXr argnum32 Z Reportar el contador Pp Cc gt Nr gt 1 espera la proxima consulta del UART antes de cambiar el apuntador del bufrx lcpwmsema pwmsema while pwmsema lcpwmsema argnum dif sprintf buftxtstrlen buftx PC 04dNr argnum L Reportar el estado del pll Ee roi Nr gt sprintf buftx strlen buftx E 1X r estado J Cambiar al modo debug C Mm Dd Nr gt cli modo debug
12. frec eeprom read word mnvfrec else 4 frec 879 2 uint16 t PINC amp Ox7f ds calcds frec funmain pll main funinter pll inter void debug main 1 void debug inter 1 OCR2 uint8 t acc 24 if TIFR amp BV ICF1 TIFR BV ICF1 contvco ICR1 dif contvco ucontvco ucontvco contvco error int32 t dif int32 t BITS FREC int32 t ESCALA DIV HW acc amp Ox00ffffff acc VCO 11 ds SE 2011 La kehuelga radio void modo_debug amp 0x00 acc 0x80000007 funmain debug_main funinter debug_inter int32_t calcds int16_t frec ldiv_t debe_ser int32_t dsint debe ser ldiv long FREC CPU x long ESCALA long frec dsint debe ser quot BITS FREC debe ser ldiv debe ser rem k BITS FREC long frec dsint debe ser quot return dsint 4 2 modos h Copyright 2010 la kehuelga radio This program is free software you can redistribute it and or modify git under the terms of the GNU General Public License as published by the Free Software Foundation either version 3 of the License or at your option any later version This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details You should have received a copy of
13. icense as published by the Free Software Foundation either version 3 of the License or at your option any later version This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details You should have received a copy of the GNU General Public License along with this program If not see lt http www gnu org licenses gt ifndef VACA_H define VACA_H define F_CPU 16000000UL estado inicial programado en la lnvram define NV_FREC 1029 25 SE 2011 La kehuelga radio define NV AMP Oxff define NV IF 0x01 define NV IA Mi valores para el pll define KV 1 define KS 16 define KRAPIDO 8 unos valores para el reloj de UART UBRR con fosc 16MHz UB2x 0 define BAUD_2400 416 define BAUD_4800 207 define BAUD_9600 103 define BAUD_19200 51 define BAUD_38400 25 define BAUD BAUD_9600 ref defs en ADMUX define ADCREF _BV REFSO ADC preescaler etc en ADCSRA define ADCPRE _BV ADEN _BV ADPS2 _BV ADPS1 BV ADPSO pines para controlar otros equipos define PINES CONTROL PORTD define PC DDR DDRD define PCIZQ 2 tamafios de los buffers define CARS_BUFTX 32 define CARS_BUFRX 32 valor maximo del error del VCO para considerar fija la frecuencia define ERROR_MAX 5000000 cuan
14. io 4 4 i i i i i i i i i i i VO ui ui ui Codigo Fuente 1 modos c Copyright 2010 la kehuelga radio This program is free software you can redistribute it and or modify qit under the terms of the GNU General Public License as published by the Free Software Foundation either version 3 of the License or at your option any later version This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details You should have received a copy of the GNU General Public License along with this program If not see http www gnu org licenses nclude lt stdlib h gt nclude lt stdint h gt nclude stdio h nclude math h nclude string h nclude avr io h nclude avr eeprom h nclude avr interrupt h nclude util delay h nclude vaca h nclude serial h las funciones que corren en main y en la interrupci n respectivamente k id kfunmain kfuninter semaforo de la interrupci n pwm definido en vaca c nte t pwmsema nt8 t estado 0 amp nt16 t dif contvco ucontvco veces inti6_t frec ui nt32 t ds lvco 7 vco 0x80707007 int32 t error st atic uint32_t acc 7 SE 2011 La kehuelga radio uint16 t nvfrec attribute section eepr
15. io de los dipswitch Ii Ff Ss r gt eeprom_write_byte amp nvfi 0x00 sprintf buftx strlen buftx IFS r A 4 Frecuencia de inicio de la nvram Ti Ff Mm r gt eeprom_write_byte amp nvfi 0x01 sprintf buftxtstrlen buftx IFM r i Reportar fuente de la frecuencia de inicio C Ia Ff C E e gt argnum eeprom read byte nvfi sprintf buftxtstrlen buftx IF 1CNr argnum M S L Reportar los interruptores 17 SE 2011 La kehuelga radio Ss 7 r gt sprintf buftx strlen buftx S 02X r leer dipsuw Cambiar un pin de control Pp 0 3 argnum ts 1 0 01 bitc ts 2 E r gt if bite 0 A PINES_CONTROL _BV PCIZQ uint8_t argnum else 1 PINES CONTROL amp _BV PCIZQ uint8 t argnum sprintf buftx strlen buftx P 1X 1cXr argnum bitc LS Reportar un pin de control Pp 0 3 fargnum ts 1 0 EC r gt printf buftx strlen buftx P 1X 1c r argnum PINES_CONTROL amp _BV PCIZQ argnum 1 0 ie Reportar un canal del ADC Vv 0 7 sscanf ts 1 41x amp argnum 0 Cr gt ADMUX amp Oxf8 ADMUX uint8 t argnum un poco mas tiempo para el muestreo _delay_us 100 ADCSRA BV ADSC loop until bit is clear ADCSRA ADSC r
16. later version This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details 13 SE 2011 La kehuelga radio You should have received a copy of the GNU General Public License along with this program If not see http www gnu org licenses ifndef SERIAL_H define SERIAL_H extern uint8 t btx brx bufrx buftx void init UART void init scaner void bufrx_inicio void envia UART void Leer cmds Hendif 4 4 serial rl Copyright 2010 la kehuelga radio This program is free software you can redistribute it and or modify git under the terms of the GNU General Public License as published by the Free Software Foundation either version 3 of the License or at your option any later version This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details You should have received a copy of the GNU General Public License along with this program If not see lt http www gnu org licenses gt k k c k tinclude lt stdlib h gt include lt stdint h gt tinclude lt stdio h gt tinclude lt math h gt tinclude lt string h gt include lt avr
17. me eL L w o A ao TE 4 5 a so CO j elo sn povez a rno T Loy cm wire 919 Spe AS an adzy 001 aj tir n sos sno Par oze AN ki II aid werte Organ ZIS kel e VT ss E and Py EN ES Feo e le Hada vol ODO o a SSA D 2 z z xi a L lee se ap wOVw TT oz an OpOLOHIL id E i H d DIP sue qa qe 1 l eek ai z ad0001 ou Liu ano Bei ero seo Vase co Ka eu s19 am Cum mfe ZEZSU ASI REH YP UL Im en 90184 001 ou awe f doce e gu 229 7 OLHSAW DD UU AU P Au 1e5edy lt H w D 98A AH epes BETEN HUOZ Kaze SN d RECH Se veo E MS em N YP Up 91419 e E E y Tas SSA e ml EI 128 140004 p ED oze Div Lom il 94 su F m vo eu L ade Su 26 w 124 door e ae Tjino mu E z TS TI T ai ke T d 99 n E in sos ti anoo ano g EZ Gel door dar wei ny wise r 880 19 629 vo Le we Di mi A E D 8pLhUL MA E ML 14000 140001 anio al Ant al ange za Wu 20 so 9 ES to D TP UL BIE e 2 Tn T aeo ep opesuan ed 3 anzz SEH anzo T A la ssezdLn LL zl mo seo I m sb AL seu i ES zu BI BI zy 09 089 Ed 189 1001 ae ou eu 168 AZE ENN SE 2011 La kehuelga radio 3 2 PCB aloon IE Hu ak E EW 2011 La kehuelga radio OSO 3 2 1 Tarjeta madre 0138 ojal10 i Y EMI 2011 La kehuelga radio 3 2 2 Tarjeta de comunicaci n serial d E AOS SE 2011 La kehuelga rad
18. ncia de operaci n as F1021 Eso significa que la frecuencia de operaci n del excitador es 102 1 MHz 2 2 C mo seleccionar la frecuencia El comando para seleccionar la frecuencia tiene la forma Fiiii La f puede ser min scula o may scula iiii debe sustituirse por la frecuencia de operaci n en megahertz multiplicada por 10 El excitador responde con el mensaje Fiiii Por ejemplo si queremos operar el excitador a 105 3 MHz el comando ser a F1053 2 3 C mo controlar la potencia Es posible controlar la potencia del excitador el comando tiene la forma Ahh hh es un n mero expresado en base hexadecimal que va desde 00 hasta FF 00 es la potencia m nima y FF la m xima El excitador debe responder con Ahh SE 2011 La kehuelga radio 2 4 Referencia de comandos Hay bastantes comandos para cambiar y conocer el estado del excitador estan resumidos en el siguiente cuadro en el que 7 se refiere a un digito decimal y h a un digito hexadecimal Comando Descripcion Respuesta Error Ahh Cambia la potencia Ahh A Reporta la potencia Ahh GA Guarda la potencia en la EEPROM GAhA RA Restaura la potencia desde la EE RAhh PROM IAM La potencia de inicio se lee de la EE IAM PROM IAO Hace que la potencia de inicio sea 0 TAO IA Reporta la fuente de la potencia de TAM IAO inicio Fs Cambia la frecuencia Fi ERROR Frec INVALIDA F Reporta la frecuencia Faia GF Guarda la frecuencia seleccionada en GF la EEPROM IFS
19. om NV FREC uint8_t nvamp attribute section eeprom NV AMP uint8_t nvfi attribute section eeprom NV_IF uint8_t nvai attribute section eeprom NV IA void pll main 1 static uint8_t upwmsema 0 if estado 1 PORTB _BV PBO else PORTB amp _BV PBO if pwmsema upwmsema if veces lt 65500 veces uint8_t pwmsema upwmsema upwmsema pwmsema if veces gt 62000 1 estado 1 if veces gt 50000 1 OCRO amp Ji void pll_inter OCR2 uint8 t acc gt gt 24 if TIFR amp BV ICF1 TIFR _BV ICF1 contvco ICR1 dif contvco ucontvco ucontvco contvco error int32_t dif int32 t BITS FREC int32 t ESCALA DIV_HW ds lvco Oxffffffff gt gt KS lvco error veo int32 t lvco gt gt KS if estado 0 vco error gt gt KRAPIDO 10 SE 2011 La kehuelga radio acc amp OxOOffffff acc VCO void modo pll estado 0 veces 0 si el pin 7 del dipswitch no esta en modo manual y la fuente de la amplitud de inicio es cero entonces la amplitud de inicio es 0 En todos los dem s casos la amplitud de inicio es la que est guardada en la EEPROM x if PINC amp 0x80 amp amp eeprom read byte fnvai 0711 1 amp 0 else 4 amp eeprom read byte mnvamp if PINC amp 0x80 amp amp eeprom read byte knvfi 1
20. se 1 espera la proxima consulta del UART antes de cambiar el apuntador del bufrx lcpwmsema pwmsema while pwmsema lcpwmsema hay brx ts if brx bufrx gt 12 brx bufrx hay memmove bufrx ts hay te bufrx te ts p bufrx p ts ts bufrx 4 5 vaca c ti Copyright 2010 la kehuelga radio This program is free software you can redistribute it and or modify git under the terms of the GNU General Public License as published by the Free Software Foundation either version 3 of the License or at your option any later version This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU General Public License for more details You should have received a copy of the GNU General Public License along with this program If not see http www gnu org licenses nclude stdlib h 22 SE 2011 La kehuelga radio include lt stdint h gt include lt stdio h gt include lt math h gt include lt string h gt include lt avr io h gt tinclude avr eeprom h tinclude avr interrupt h tinclude lt util delay h gt include vaca h tinclude serial h tinclude modos h FUSES low Oxff high FUSE BOOTSZO amp FUSE_BOOTSZ1 amp FUSE_SPIEN amp FUSE_JTAGEN amp FUSE OCDEN void init_pines DDRB
21. tas veces el error del VCO tiene que ser menor que ERROR_MAX para considerar fija la frecuencia define ERROR_ESPERA 300 frecuencia del cpu en multiplos de 100kHz define FREC_CPU 160 divisor de vco en hardware define DIV_HW 4096 26 SE 2011 La kehuelga radio Potencia minima de 2 mas grande que la frec maxima en multiplos de 100kHz define BITS FREC 0x400 factor escalador de frec para aprovechar la precision maxima de un int32_t define ESCALA 0x800000 int32 t calcds int16 t frec uint8 t leer dipsw tendif 4 7 Makefile HHHHHHHHHHHHHHHHHHHHHHHHHEHHHHHHHHHHH HEE HEHEHE EEE La vaca MUUUU la vaca EENHEETEN EEN END General PROJECT vaca MCU atmega32 TARGET vaca elf CC avr gcc HEHE 4 Opciones para los varios programadores debug HEHE HFUSE debe ser 0x10 para usar el JTAG y Oxd8 para usar los dipswitch OR con 0x01 para deshabilitar el bootloader OR con OxO2 para tener espacio de bootloader de 1k en lugar de 2k AND con Oxf7 para preservar el eeprom a pesar del chip erase LOCK totalmente deshabilitado es Oxff OR con Ox7f para proteger el bootloader deshabilitar la instrucci n SPM Ht en la secci n del bootloader PORT dev ttyUSBO BAUD 9600 HEXFILE vaca hex EEPROMFILE vaca eep PROGRAMMER avr109 DIRBOOT avrprog_boot_v0_85 4 Deshabilita el modo seguro el bootloader no podr restaurar los fusibles 27 SE 2011
22. the GNU General Public License along with this program If not see http www gnu org licenses ifndef MODOS_H define MODOS_H para definir un modo hay que escribir 3 elementos 1 las funciones que corren en main y en la interrupci n del pwm Estas 2 12 SE 2011 La kehuelga radio ex ex ex ex ex ex funciones tienen la forma void nombre_main void void nombre_inter void 2 una funci n para inicializar el modo con la forma void modo_nombre void 3 Un comando del puerto serial definido en serial rl para entrar en el modo Y quiz s m s comandos para usarlo Para ver ejemplos mira los que est n en serial rl y modos c tern void modo debug tern void modo pll tern void kfuninter kfunmain tern uint8_t pwmsema estado vestado amp tern inti6_t frec tern uint16 t veces dif extern int32 t ds extern int32 t error extern uint32 t vco extern uint16 t nvfrec attribute section eeprom extern uint8_t nvamp attribute section eeprom extern uint8 t nvai extern uint8 t nvfi te _attribute__ section eeprom _attribute__ section eeprom ndif 4 3 serial h Copyright 2010 la kehuelga radio This program is free software you can redistribute it and or modify git under the terms of the GNU General Public License as published by the Free Software Foundation either version 3 of the License or at your option any
Download Pdf Manuals
Related Search
Related Contents
model description HP LaserJet M1319 Series MFP User Guide Philips HP6520/70 User's Manual USER`S MANUAL - American Weigh Scales Inc Polaroid PDV-523M2 User's Manual Samsung SGH-I560V Εγχειρίδιο χρήσης 取扱説明書はこちら Philips 14PT2116 14" TV Copyright © All rights reserved.
Failed to retrieve file