Arduino as ISP problem

Hi! I want to use my arduino UNO as ISP programmer to write in another atmega328p (32TQFP), but when I burn successfully the bootloader, atmega328 doesnt work. That looks like as if the chip has never been burn. I wanted to know if you could help me about this problem.

thanks
Leandro

How is the newly programmed part wired up? Perhaps something is missing. Do you have a schematic?

Can you share a photo of your new atmega328? If you burned the bootloader, did you also set the fuse correctly? Without setting the fuse, the bootloader will not run.

Here is the schematic and the code that Ive used, Im new in this foro and sory about my poor english.

![](http://C:\Users\Leandro\Desktop\Leandro\Sensor magnético\Placa con atmega328)

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Programa básico que permite habilitar o no el acceso segun la UID de la tarjeta adaptado para Arduino UNO//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////

/* Para arduino UNO

Pin Arduino UNO Pin físico ATMEGA328P (32 tqfp)
SCK --> 13 17
MISO --> 12 16
MOSI --> 11 15
SS --> 10 14
pin --> 7 11
RESET --> 9 13
Buz --> 0 30
*/

#include <SPI.h>
#include <MFRC522.h>
#include <EEPROM.h>
#include <LowPower.h>

#define INT_PIN 2
#define RST_PIN 9 // Pin 5 de Arduino Mega, 9 para arduino uno
#define SS_PIN 10 // Pin 53 de Arduino Mega, 10 para arduino uno
#define pin 7 // Para energizar un solenoide
#define Buz 2 // Para hacer sonar el Buzzer, pin 41 en Arduino Mega

MFRC522 mfrc522(SS_PIN, RST_PIN); // Crea un objeto de la clase MFRC522

MFRC522::MIFARE_Key key;

byte UID1[4]= {0x00, 0x00, 0x00, 0x00}; //Me sirve para no cometer el error de guardar la misma uid dentro de la EEPROM
byte sector=0;

int cont=0, n=0, m=0;
int poseeprom=0;
float t0=0, t1=0, t3;

//////////////////
//Inicialización//
//////////////////

void setup()
{
TCCR0B = (TCCR0B & 0xF8) | 0x05; //Preescaler igual a 1024 (para bajar el consumo)
Serial.begin(9600); // Initializamos la comunicación serie a 9600 baudios
while (!Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
SPI.begin(); // Inicializamos la comunicación SPI

pinMode(INT_PIN, INPUT);
pinMode(pin, OUTPUT);
pinMode(Buz, OUTPUT);

mfrc522.PCD_Init(); // Inicializamos el MFRC522
mfrc522.PCD_WriteRegister(mfrc522.ComIEnReg,0b10100000); //Habilitamos la interrupción que se ejecutará luego de finalizar una resepción de datos
mfrc522.PCD_WriteRegister(mfrc522.DivIEnReg,0b10000000);
//mfrc522.PCD_WriteRegister(mfrc522.ComIrqReg,0b00000001);

LowPower.idle(SLEEP_FOREVER, ADC_OFF, TIMER2_OFF, TIMER1_OFF, TIMER0_ON, SPI_ON, USART0_OFF, TWI_OFF); //Solo activo el Timer 0 y el modulo SPI

}

//////////////////
//Loop Principal//
//////////////////

void loop()
{
//Primero testea que alguna tarjeta este inmersa en el campo electromagnético del PICC
if(cont!=1)
{
cont++;
usuario();
}

while(!mfrc522.PICC_IsNewCardPresent() || !mfrc522.PICC_ReadCardSerial())
{
delay(3);
}

if(((EEPROM.read(0)==mfrc522.uid.uidByte[0] && EEPROM.read(1)==mfrc522.uid.uidByte[1] && EEPROM.read(2)==mfrc522.uid.uidByte[2] && EEPROM.read(3)==mfrc522.uid.uidByte[3]) || (EEPROM.read(4)==mfrc522.uid.uidByte[0] && EEPROM.read(5)==mfrc522.uid.uidByte[1] && EEPROM.read(6)==mfrc522.uid.uidByte[2] && EEPROM.read(7)==mfrc522.uid.uidByte[3])) && EEPROM.read(8)!=0)
{
Buzzer();
digitalWrite(pin, HIGH);
delay(312);
digitalWrite(pin, LOW);
Buzzer();
}
else
{
Buzzer();
Buzzer();
Buzzer();
}

// Halt PICC
mfrc522.PICC_HaltA();
// Stop encryption on PCD
mfrc522.PCD_StopCrypto1();
}

/////////////
//Funciones//
/////////////

////////////////////////////////////////////////////////////////////////////////
//Función que saca el valor de un registro en serie y en valores hexadecimales//
////////////////////////////////////////////////////////////////////////////////

void dump_byte_array(byte buffer, byte bufferSize)
{
for (byte i = 0; i < bufferSize; i++)
{
buffer < 0x10;
_ Serial.print(buffer
, HEX);_
_
}_
_
}_
_
//////////////////////////////////////////////////////_
_
//Función que permite el ingreso de uno o 2 usuarios//_
_
//////////////////////////////////////////////////////_
void usuario()
_
{_
_
//Primero testea que alguna tarjeta este inmersa en el campo electromagnético del PICC*_

* while(EEPROM.read(8)<2)*
* {*
* Serial.print("Ingrese la tarjeta numero: ");*
* Serial.println(poseeprom + 1);*

* while((!mfrc522.PICC_IsNewCardPresent() || !mfrc522.PICC_ReadCardSerial()) && m==0)
_
{_
_
delay(3);_
_
}*_

* t0=millis();*
* //Serial.println(t0);*
* //Serial.println(t1);*
* //t3=t1-t0;*
* //Serial.println(t3);*

* do*
* {*
* t1=millis();*
* //delay(50);*
* }*
* while(((!mfrc522.PICC_IsNewCardPresent() || !mfrc522.PICC_ReadCardSerial()) || (UID1[0]==mfrc522.uid.uidByte[0] && UID1[1]==mfrc522.uid.uidByte[1] && UID1[2]==mfrc522.uid.uidByte[2] && UID1[3]==mfrc522.uid.uidByte[3])) && m==1 && abs(t1-t0)<500);*

* //Serial.println(t1-t0);*
* m=1;*
* if(((t1-t0)<500 && EEPROM.read(8)==1) || EEPROM.read(8)==0)*
* {*
* Serial.print(F("Card UID:"));*
* dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);
_
Serial.println();_
_
Buzzer();_
_
delay(12);_
_
Buzzer();_
_
for(int i=0;i<4;i++)_
_
{_
_ EEPROM.put(i+n,mfrc522.uid.uidByte);
UID1=mfrc522.uid.uidByte;
}
}
else*

* {
Buzzer();
Buzzer();
Buzzer();
}*_

* n=n+4;*
* poseeprom++;*

* EEPROM.put(8,poseeprom);*

* // Halt PICC*
* mfrc522.PICC_HaltA();
_ // Stop encryption on PCD*_

* mfrc522.PCD_StopCrypto1();*

* }*
* for(int i=0; i<9;i++)*
* {*
* //EEPROM.put(i,0); //Para borrar la eeprom*
* Serial.println(EEPROM.read(i), HEX);*
* //delay(1000); *
* } *
}
///////////////////////////////////////////////////////////////////////////////////////////////
//funcion que se ejecuta cunado tiene lugar la interrupcion por teclado, hace sonar el buzzer//
///////////////////////////////////////////////////////////////////////////////////////////////
void Buzzer()
{
* for(int i=0;i<600;i++)*
* {*
* digitalWrite(Buz,HIGH);//------*
* delayMicroseconds(100);// |208us|208us|
digitalWrite(Buz,LOW);
delayMicroseconds(100);// |---416us---| es aproximadamente la frecuencia de resonancia del QMT12A12*

* }
delay(2);
}*_

![](http://C:\Users\Leandro\Desktop\Leandro\Sensor magnético\Placa con atmega328)

Use the code tool above

This link have the schema cause I cant upload in the foro, sory :S

The sketch is about RFID comunication, that reads two cards UID and save this code in the eeprom of the atmega328p. Then I compare these codes with some cards which have different codes, in this case the relay doesnt be enabled, but if I compare with the true codes the relay will be activated.

Ok, I think I ve discovered how to upload files X) sory. Lets see..

Adaptado_a_Arduino_UNO_mas_Buzer_mas_preescaler_1024_mas_smd.ino (6.3 KB)

I tried with another arduino uno and It does the same, nothing. I tried with two arduinos, the first one as programmer and the other one as stand alone chip, but the same thing. I read many of tutorials but nothing tells about this particular problem. :S

Re-Read #2. Simple English: post YOUR hookup photo, not others' scheme.