Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Avr test circuit and program

Status
Not open for further replies.
ok i'll try.
i understand connecting the power on LED,the hows this in process indicator work.i wonder how the circuit detects and lightup LED when it is burning the chip??
 
Nigel will probably be a better source on this as he has writting PIC programming software. I would drop a scope on the VPP signal line and burn a chip. See what voltage you have to deal with and then try that to resistor to LED to ground.
 
mramos1 said:
Nigel will probably be a better source on this as he has writting PIC programming software. I would drop a scope on the VPP signal line and burn a chip. See what voltage you have to deal with and then try that to resistor to LED to ground.

No idea on an 8051?, but for a PIC you apply 13V to the MCLR (reset) pin to set it to programming mode, you need to go straight from 0V to 13V, and NOT from 5V, as if the clock oscillator starts running you can't enter programming mode.
 
So he can use ohms law and use 10ma for the LED and 13volts for power and drop an LED and resistor on VPP to ground and have his BURN light most likley.
 
tiny2313

eblc1388

In the tiny2313 data sheet (doc2543.pdf, 231 pages) on page 13 is a picture of SPL and SPH. Underneath the picture you can see the initial values of both registers is zero. This will probably not work without initialization since the registers are located at zero, and the SRAM ends at 0xDF. I suggest that for this part loading SPL with 0xDF would be de rigeur.
 
Thanks Papabravo, can't believe I'd miss that.

To mramos1,

The programmer steev mentioned is just a few resistors connected to the parallel port. There is no +13V Vpp signal.
 
connect reset to Vcc. See at what frequency ur micro is running. See fuse bits

Here is a simple program compiled in WinAVR
#include<avr/io.h>
void delay_ms(unsigned char time_ms);
main()
{
DDRC=0xff;
DDRA=0xff;
DDRB=0xff;
DDRD=0xff;

while(1)
{
PORTC=0X00;
PORTA=0X00;
PORTB=0X00;
PORTD=0X00;
delay_ms(200);
PORTA=0Xff;
PORTB=0Xff;
PORTC=0Xff;
PORTD=0Xff;
delay_ms(200);
}
return(0);
}

void delay_ms(unsigned char time_ms)
{
unsigned short delay_count = F_CPU / 4000;

unsigned short cnt;
asm volatile ("\n"
"L_dl1%=:\n\t"
"mov %A0, %A2\n\t"
"mov %B0, %B2\n"
"L_dl2%=:\n\t"
"sbiw %A0, 1\n\t"
"brne L_dl2%=\n\t"
"dec %1\n\t" "brne L_dl1%=\n\t":"=&w" (cnt)
:"r"(time_ms), "r"((unsigned short) (delay_count))
);
}

for more
MY EXPERIENCE IN PROGRAMMIGN AVR MICROCONTROLLER IN C USING WINAVR/AVRGCC

you can get it from yahoo group-booksbybibin
http://groups.yahoo.com/group/booksbybibin/

comments about this book
http://www.booksbybibin.blogspot.com/
delete
 
bibinjohn said:
connect reset to Vcc. See at what frequency ur micro is running. See fuse bits

Here is a simple program compiled in WinAVR
#include<avr/io.h>
void delay_ms(unsigned char time_ms);
main()
{
DDRC=0xff;
DDRA=0xff;
DDRB=0xff;
DDRD=0xff;

while(1)
{
PORTC=0X00;
PORTA=0X00;
PORTB=0X00;
PORTD=0X00;
delay_ms(200);
PORTA=0Xff;
PORTB=0Xff;
PORTC=0Xff;
PORTD=0Xff;
delay_ms(200);
}
return(0);
}

void delay_ms(unsigned char time_ms)
{
unsigned short delay_count = F_CPU / 4000;

unsigned short cnt;
asm volatile ("\n"
"L_dl1%=:\n\t"
"mov %A0, %A2\n\t"
"mov %B0, %B2\n"
"L_dl2%=:\n\t"
"sbiw %A0, 1\n\t"
"brne L_dl2%=\n\t"
"dec %1\n\t" "brne L_dl1%=\n\t":"=&w" (cnt)
:"r"(time_ms), "r"((unsigned short) (delay_count))
);
}

is this for LED test circuit??
 
i found another one.
**broken link removed**
one doubt the crystall we r using in this test circuit decides the LED blink rate right?
 
akg said:
the delay routines are based on the clock speed. so if u get a delay(200)@Mhz , it reduces to 100msec when using a 8Mhz clock
PS: if u were using assembly programming , u would have definitely noted that before.

well then can i use 4Mhz crystal with the same ckt and same code?
i just don't want to change any clock settings of my AT90S2313

sounds like dumb question.sorry iam little new to these :D
 
???
guys i just tried this ckt(**broken link removed**) but its not working ;-(
am i doing something wrong? do i need to connect a resistor across the reset pin?
 
I have used the Atmel for many years, and now I am back to the PICs. I have never had to put a pullup on the reset. On the PIC yes, AVR never.

Looks at bastoc.com and pull rvkbasic. It is easy to use and works well for more chips.
 
mramos1 said:
Oh, no external power supply might be a problem. Might try LED and 2K resistor on power if you are looking an ON LED. I don't think it will hurt the port, chip might not verify after burning worst case.

pin 1 from printer port(male) is also giving voltage.so can i connect LED between pin 1 and ground(25),for ON led.
or i sjhld use only Vss pins 2,3,4
 
nice collection of test programs.
i tried hello world program to test my LCD.its not working???
any ideas?
and can u show me some ckts to test LCD using at90s2313
thanks
 
Status
Not open for further replies.

Latest threads

Back
Top