Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ATmega328p and USB conection to PC

Status
Not open for further replies.

zarzisur

Newbie level 5
Joined
May 24, 2017
Messages
8
Helped
2
Reputation
4
Reaction score
1
Trophy points
3
Activity points
100
I wanted to blink a led every 1s connected with PORTB0 pin of Atmega 328p microprocessor. I have used USBASP programmer.The connection USBASP with 328p is like this: MOSI-17 MISO-18 SCK-19 RESET-1 GND-8 VCC-7 I have used a LM7805 to power the microprocessor from 9V battery,i have used two 1uF capacitor in input and output port of LM7805. I wanted to implement this code:

code.PNG

Which should toggle LED at portb0 in every 1s.

But my led starts to glow for around 5s after the microprocessor has burnt and keeps glowing from then,it doesnt stop anytime after then.

the output window of atmelstudio 7 shows this:

avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update. avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e950f avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be performed To disable this feature, specify the -D option. avrdude.exe: erasing chip avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update. avrdude.exe: reading input file "C:\Users\Rony\Documents\Atmel Studio\7.0\1st avr prog\1st avr prog\Debug\1st avr prog.hex" avrdude.exe: writing flash (196 bytes):

Writing | ################################################## | 100% 0.14s

avrdude.exe: 196 bytes of flash written avrdude.exe: verifying flash memory against C:\Users\Rony\Documents\Atmel Studio\7.0\1st avr prog\1st avr prog\Debug\1st avr prog.hex: avrdude.exe: load data flash data from input file C:\Users\Rony\Documents\Atmel Studio\7.0\1st avr prog\1st avr prog\Debug\1st avr prog.hex: avrdude.exe: input file C:\Users\Rony\Documents\Atmel Studio\7.0\1st avr prog\1st avr prog\Debug\1st avr prog.hex contains 196 bytes avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 0.10s

avrdude.exe: verifying ... avrdude.exe: 196 bytes of flash verified

avrdude.exe: safemode: Fuses OK

avrdude.exe done. Thank you.

WHAT IS THE PROBLEM?

i have used also used a external 16mhz clock,but still it shows ssame result.

One of my friend told me that in windows 10 i have to turn offf the device signate.I have turned off device signature and when i tried to update the driver again it shows that my driver is already up to date so it wont take a new driver.
 

Should be clock issues

Set proper clock rate. Have a look into fuse bytes in datasheets

Do some simple test like just turning on a bit rather than toggling
 

Hi,

Maybe it's the RESET connection.
Show us your complete curcuit.

BTW: Please set up all ports. Don't let any pin floating, in doubt use the "pull up" feature.

Klaus
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top