TODOPIC
Otros Microcontroladores / Dispositivos programables => Microcontroladores 8 bits => Mensaje iniciado por: dekike en 10 de Enero de 2009, 20:45:12
-
Hola mis amigos programadores, estoy contento por la participacion de esta comunidad respecto a los AVR.
Bueno tengo un problema con el Atmega16. He estado programandolo a traves de ISP, y funcionando bien. Luego comence a probar con diferentes configuraciones de los fuse bits y de repente el micro no se deja programar ni leer, ni nada. Sospecho que el problema esta en alguna configuracion de los fuse bits que le programe y lo bloqueo.
Si alguno sabe o ha tenido el problema y lo ha resuelto, le agradezco me colabore con la solucion. No quiero perder tremenda maquina.
Gracias.
-
A mi me paso lo mismo y en este hilo se habla del tema y de la solución.
http://www.todopic.com.ar/foros/index.php?topic=21068.msg161720#msg161720
Un saludo
-
xD eso te pasa por tenton :D
Pues hay varias sopas!
Que deshabilitaste el ISP.
QUe configuraste el pin RESET como I/O asi que por un lado no te programaria nada y por el otro nunca entrara ne programacion poruq enecesita ponerlo en RESET.
QUe Cambiaste los fuses del CLOCK entonces tendras que probar con tro clock si fue asi.
Si de plano nada de nada!
Puedes armarte el programdor elm-cham , en este mismo hilo describen lo spasos , o si tienes otro microcontrolador lo programes para
borrar los fuses en programacion paralela.
http://www.artem.ru/cgi-bin/news?c=v&id=739
Yo arme este ultimo!
Avr rescatando AVR xD
Solo revisa los pines correspondientes al modo paralelo y sigue fiel al diagrama.
Saludos!
-
Estimado AkenaFAB....
Muchas gracias por el link que dejaste pero sabes que esta en ruso, y pues trate de traducirlo pero ni aun asi se logra entender bien la programacion, sera que si tu lo probaste, me podrias ayudar con un esquema de conexion, el .HEX para grabar en el mega8 y la configuracion de Fuses por favor, yo tengo algunos M16 muertos desde hace meses...
Ah... y por cierto muy interesante todo lo que estan haciendo sobre ATMEL AVR, hace años atras yo empece a manejarlos y pues hasta hoy me quedo con ellos, lo malo que yo solo los he manejado en BASIC, he hecho muuuuuuuucccchhhhaaassss cosas con ellos pero en BASIC; con todo me voy a poner al dia del C que algun dia lo aprendi, lo malo que no tenia librerias como las que mi compilador BASCOM AVR tiene...
Bueno espero estar en contacto y seguir aprendiendo con uds. el mundo del C para Atmel..
Q gusto verlo de nuevo por aca.... y ver como ahora se mueve el foro de ATMEL..
Saludos cordiales..
Olotill...
-
Prueba contodas las formas de osciladores para el micro. A mi me fuciono con RC no se a que frecuencia por que fue un pot de 100k y u cap 22pf lo varie haste que me respondiera el micro.
-
Hola Olotill
xD Claro que no se ruso xD use el google traslator xD
Una odisea pero claro que aca muestro cmo lo hice.
Yo use un Atmega8 para rescatar otros 2 atmega8,ya no intente el atmega8535 .
Conecta PB0-PB7 del atmega8 a PB0-PB7 del atmega16 , esa es la linea de datos.
PD2-PD6 - sobre PD2-PD6
PD1 en XTAL1
PD7 a PA0
Conecta un led en RSY / BSY y el catodo a tierra.
Asi sabras cunado esta trabajando o no.Yo lo conecto al revez xD para ver bien los flashasos.
PAGEL -- a GND
Una ves que tengas todo armando , RESET ponlo a GND
Luego ENcendera 1 segundo el led eso indica que debes tener conectado el RESET a GND.
CUando vuelva a encender el led te indica que le conectes 12v a GND.
ENtre paso y paso son 5 segundos aprox. suficiente.
CUando el led empiece a parpadear , es que esta listo para bailar xD.
Revisa la configuracion de pines en modo paralelo que coincidan con los del atmega8.
Saludos!
// www.artem.ru
// (C)2008 Artem Kuchin
//
// THIS IS NOT A COMPLETE CODE!!!
// YOU MUST ADD YOU OWN LCD LIB AND REWRITE ALL CALLS TO LCD FUNCTIONS
// ****************************************
// *** SET FREQUENCY CORRECTLY **
#define F_CPU 800000UL
// ****************************************
#include <avr/io.h>
#include <inttypes.h>
#include <util/delay.h>
#include <stdlib.h>
// Los define de abajo son referentes a los pines del PORTD
#define X_XTAL1 1
#define X_OE 2
#define X_WR 3
#define X_BS1 4
#define X_XA0 5
#define X_XA1 6
#define X_BS2 7
int main() {
char i;
unsigned char data[3];
DDRC=0xff;
DDRD|=0b11111110;
//aplicar gnd a reset
PORTC=0xFF;
_delay_ms(1000);
PORTC=0;
// display ON, blinking bottom line cursor
_delay_ms(5000);
// toggle xtal1 at lease 6 times
for(i=0;i<8;i++){
PORTD|=_BV(X_XTAL1);
_delay_ms(10);
PORTD&=~_BV(X_XTAL1);
_delay_ms(10);
}
// set prog enable pins (pagel is gnd, xa0, xa1, bs1 - zero)
// PD4,PD5,PD6
PORTD&=~(_BV(X_XA0)|_BV(X_XA1)|_BV(X_BS1));
PORTD|=_BV(X_WR); // write disables
PORTC=0xFF;
_delay_ms(1000);
PORTC=0;
//aplicar 12v a reset
_delay_ms(5000);
// read signature bytes
// SET OE HIGH
PORTD|=_BV(X_OE);
DDRB=0xff;
for(i=0;i<3;i++){
// load command
//Set XA1 to 1, XA0 to 0. This enables command loading.
PORTD|=_BV(X_XA1);
PORTD&=~_BV(X_XA0);
// Set BS1 to “0”, BS1 - PD4
PORTD&=~_BV(X_BS1);
// Set DATA to command
PORTB=0b00001000; // A: Load Command “0000 1000”.
//Give XTAL1 a positive pulse. This loads the command., XTAL1 - PD1
PORTD|=_BV(X_XTAL1);_delay_ms(10);PORTD&=~_BV(X_XTAL1);_delay_ms(10);
//load address
//Set XA1 to 0, XA0 to 0. This enables address loading.
// XA1 - PD6, XA0 - PD5
PORTD&=~_BV(X_XA1);
PORTD&=~_BV(X_XA0);
// Set BS1 to “0”, BS1 - PD4
PORTD&=~_BV(X_BS1);
// Set DATA to command
PORTB=i; // addr 0
//Give XTAL1 a positive pulse. This loads the address low byte , pd1
PORTD|=_BV(X_XTAL1);_delay_ms(10);PORTD&=~_BV(X_XTAL1);_delay_ms(10);
// XA0=XA1=1
//PORTD|=_BV(X_XA0)|_BV(X_XA1);
DDRB=0;
//Set OE to “0” - OE - PD2
//the selected Signature byte can now be read at DATA.
PORTD&=~_BV(X_OE);
_delay_ms(10);
// read data
data[(int)i]=PINB;
//Set OE to “1”.
PORTD|=_BV(X_OE);
DDRB=0xff;
}
_delay_ms(5000);
// read fuses and lock bits
// load command
//Set XA1 to 1, XA0 to 0. This enables command loading.
PORTD|=_BV(X_XA1);
PORTD&=~_BV(X_XA0);
// Set BS1 to “0”, BS1 - PD4
PORTD&=~_BV(X_BS1);
// Set DATA to command
PORTB=0b00000100; // A: Load Command “0000 1000”.
//Give XTAL1 a positive pulse. This loads the command., XTAL1 - PD1
PORTD|=_BV(X_XTAL1);_delay_ms(10);PORTD&=~_BV(X_XTAL1);_delay_ms(10);
i=0;
DDRB=0;
PORTD&=~_BV(X_OE);
// fuse low byte
PORTD&=~_BV(X_BS1);
PORTD&=~_BV(X_BS2);
_delay_ms(10);
// read data
data[(int)i]=PINB;
i++;
// fuse high byte
PORTD|=_BV(X_BS1);
PORTD|=_BV(X_BS2);
_delay_ms(10);
// read data
data[(int)i]=PINB;
i++;
// lock bits
PORTD|=_BV(X_BS1);
PORTD&=~_BV(X_BS2);
_delay_ms(10);
// read data
data[(int)i]=PINB;
// disable output
PORTD|=_BV(X_OE);
DDRB=0xff;
_delay_ms(5000);
for(i=10;i>0;i--){
_delay_ms(100);
}
DDRD|=0b11111110;
// chip erase
//Set XA1 to 1, XA0 to 0. This enables command loading.
PORTD|=_BV(X_XA1);
PORTD&=~_BV(X_XA0);
// Set BS1 to “0”, BS1 - PD4
PORTD&=~_BV(X_BS1);
// Set DATA to command
PORTB=0b10000000;
//Give XTAL1 a positive pulse. This loads the command., XTAL1 - PD1
PORTD|=_BV(X_XTAL1);_delay_ms(10);PORTD&=~_BV(X_XTAL1);_delay_ms(10);
// Give WR a negative pulse. This starts the Chip Erase. RDY/BSY goes low.
PORTD&=~_BV(X_WR);_delay_ms(10);PORTD|=_BV(X_WR);_delay_ms(10);
// Wait until RDY/BSY goes high before loading a new command.
// load default data for FUSE low byte
//Set XA1 to 1, XA0 to 0. This enables command loading.
PORTD|=_BV(X_XA1);
PORTD&=~_BV(X_XA0);
// Set BS1 to “0”, BS1 - PD4
PORTD&=~_BV(X_BS1);
// Set DATA to command
PORTB=0b01000000;
//Give XTAL1 a positive pulse. This loads the command., XTAL1 - PD1
PORTD|=_BV(X_XTAL1);_delay_ms(10);PORTD&=~_BV(X_XTAL1);_delay_ms(10);
// load data
PORTD&=~_BV(X_XA1);
PORTD|=_BV(X_XA0);
PORTB=0b11100001; // DEFAULT VALUE FOR LOW FUSE BYTE
PORTD|=_BV(X_XTAL1);_delay_ms(10);PORTD&=~_BV(X_XTAL1);_delay_ms(10);
// Set BS1 to “0” and BS2 to “0”.
PORTD&=~_BV(X_BS1);
PORTD&=~_BV(X_BS2);
// Give WR a negative pulse. This starts the Chip Erase. RDY/BSY goes low.
PORTD&=~_BV(X_WR);_delay_ms(10);PORTD|=_BV(X_WR);_delay_ms(10);
// load default data for HIGH low byte
//Set XA1 to 1, XA0 to 0. This enables command loading.
PORTD|=_BV(X_XA1);
PORTD&=~_BV(X_XA0);
// Set BS1 to “0”, BS1 - PD4
PORTD&=~_BV(X_BS1);
// Set DATA to command
PORTB=0b01000000;
//Give XTAL1 a positive pulse. This loads the command., XTAL1 - PD1
PORTD|=_BV(X_XTAL1);_delay_ms(10);PORTD&=~_BV(X_XTAL1);_delay_ms(10);
// load data
PORTD&=~_BV(X_XA1);
PORTD|=_BV(X_XA0);
PORTB=0b10011001; // DEFAULT VALUE FOR HIGH FUSE BYTE
PORTD|=_BV(X_XTAL1);_delay_ms(10);PORTD&=~_BV(X_XTAL1);_delay_ms(10);
// Set BS1 to “0” and BS2 to “0”.
PORTD|=_BV(X_BS1);
PORTD&=~_BV(X_BS2);
// Give WR a negative pulse. This starts the Chip Erase. RDY/BSY goes low.
PORTD&=~_BV(X_WR);_delay_ms(10);PORTD|=_BV(X_WR);_delay_ms(10);
while(1){ PORTC=0xFF;
_delay_ms(500);
PORTC=0;
_delay_ms(500);
}
}
(http://img80.imageshack.us/img80/3002/atmega32jj0.jpg)
Te adjunto el hex. Use un cristal de 8MHz.
-
Estimado AKENAFAB....
Muchas gracias por tu aporte, mira mi amigo, a mi no me gusta armar nada en proto asi que voy a diseñar el circuito y lo posteo para que lo revises, luego hago la plaquita y lo pruebo ok, si todo va bien entonces ya tendremos en placa un revividor de micros ATMEL... :-/ :-/
Te dejo tambien mi correo para que me agregues al MSN, asi podemos charlar un poco sobre estos bichos.... fabortizv@hotmail.com
Espero entonces pronto poder hablar ocntigo he intercambiar experiencias e ir aprendiendo otra vez micros en C jejeje
Saludos mi amigo y muchas gracias..
Tu amigo... Olotill
-
que bien AKENAFAB...muy buena info
olotill
seria estupendo una placa resucitador de avr :mrgreen: :mrgreen:..
estaremos pendienes...
-
AKENAFAB eso diagrama es para recuperar un atmega16 pero como es para recuperar un atmega8. Por que portb comparten con el cristal. Dame una ayuda por que tengo varios atmega8 con problemas de fuses.
-
Yo desbloquié atmega8 , con ese diagrama.
Lo segui tal cual. solo revisa los pines de programacion paralela.
---------------
Use un atmega8 para rescatar otro Atmega8.
-
alguien ah tendio la oportunidad o conocia el HVprog que tal sera????
Link (http://www.der-hammer.info/hvprog/index_en.htm)
(http://www.der-hammer.info/hvprog/mod/mod2_gross.jpg)
-
yo arme el fusebit doctor y funciona perfectamente
con la mayoria de atmegas y attiny
-
yo arme el fusebit doctor y funciona perfectamente
con la mayoria de atmegas y attiny
hola rafa95el yo estoy montando uno y no estoy muy seguro si el boton start es pulsador o interutor yo e puesto pulsador .