Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 4th April 2008, 05:16 PM   (permalink)
Default Avr Not working!!

Hey ;

i have atmega32 i programmed it by ponyprog
it tells me (( write successful)) but when i put it on bread board and put it into the circuit it doesn't work (( NO o/p)

What is the sol. ????????
kemo0o is offline  
Old 4th April 2008, 05:48 PM   (permalink)
Default

what about my device ????
kemo0o is offline  
Old 4th April 2008, 05:49 PM   (permalink)
Default

Including more information might help, like I did;

http://www.electro-tech-online.com/m...-pic16f54.html
zanes is offline  
Old 4th April 2008, 06:34 PM   (permalink)
Default

my program works on proteus with no problems
but in fact it doesn't work ? idon't know why
may be the mega32 is not working ??

may be the mega32 not working but it could be programmed ?
kemo0o is offline  
Old 4th April 2008, 11:58 PM   (permalink)
Default

Really not enough info to guess. I use AVR Dragon and AVR Studio, so not familiar with your programmer. Can you verify or read back what was written to the chip? If the program is in the chip, you know chip is probably good, and need to look for another problem. Checked your fuse bits? I've only changed a few, but know you can do some messed up stuff if not set right.
Is the chip being powered correctly? Checked your data sheet? Is your program actually working code? I/Os set proper?

You need to post some pictures, schematics, and code if you hope to receive more then wild guesses or basic troubleshooting. You haven't even given a hint as to what your chip is suppose to do, or what sort of experience you have.

Is the chip expecting an external oscillator, but you haven't provided one?
HarveyH42 is offline  
Old 5th April 2008, 09:25 AM   (permalink)
Default

this is my code and sch

Code:
; WORKING ON 4MHZ CRYSTAL 


.include "m32def.inc"
.cseg

; ////Definitions////;
.DEF TMP = R16					;
.DEF LMF = R17					;
.DEF RMF = R18					;
.DEF SW  = R19					;
.DEF LF  = R20					;
.DEF LS  = R21					;
.DEF R_PWM = R22
.DEF L_PWM = R23



.ORG $000
RJMP START
;;;;;;;;;;;;;;;;;;;;;;
.ORG $014
RJMP TIM0_COMP 					; Timer0 Compare Handler INTERRUPT VECTOR

	
START:
;; ////INIT////:;;
CLI								; CLEAR ALL INTERRUPTS
LDI TMP ,HIGH(RAMEND)	
OUT SPH, TMP					; STACK POINTER HIGH
LDI TMP ,LOW(RAMEND)
OUT SPL ,TMP 					; STACK POINTER lOW							
LDI TMP , 0B00000000
OUT DDRB,TMP
OUT DDRA ,TMP
LDI TMP ,0XFF
OUT DDRC ,TMP					; PORTC AS I/P
OUT DDRD, TMP					; PORTD AS O/P



;;///////// CLEAR ALL REGISTERS///////////////////////;
CLR TMP
CLR SW
CLR R30							
CLR R31							

;//////////////////////////////////////////////////////;
;/// TIMERS FOR PWM HARDWARE   I USED TIMER 1 16 BIT///;
;//////////////////////////////////////////////////////;
LDI TMP , 0B11110001
OUT TCCR1A , TMP				; 
LDI TMP , 0B00001001			;
OUT TCCR1B,TMP

SEI

MAIN:

RCALL SWITCHES



RJMP MAIN

SWITCHES:
SWT:
IN SW,PINB
CPI SW,0B00000111
BREQ SWT
CPI SW,0B00000110
BREQ ST1
CPI SW,0B00000101
BREQ ST2
CPI SW,0B00000011
BREQ ST3
RET

ST1:							
LDI TMP , 0
OUT OCR1AH , TMP				
LDI R_PWM ,0X5a
OUT OCR1AL , R_PWM
LDI TMP , 0
OUT OCR1BH , TMP				
LDI L_PWM ,0X5a
OUT OCR1BL , L_PWM
RET

ST2:							;
LDI TMP,0B00000000
OUT PORTD,TMP
RET

ST3:							
LDI TMP,0B11111111
OUT PORTD,TMP
RET
and sch in attach


-- the problem:

when i apply power on micro it out ( LOGIC 1 ) high on PD5 , PD4 without pressing any switch

- Note : the chip is programmed and i read the program from it ?
so what is wrong ?? what about fuse bits ? i am using 4MHZ crystal
Attached Images
File Type: jpg fff.JPG (46.2 KB, 22 views)
kemo0o is offline  
Old 5th April 2008, 07:57 PM   (permalink)
Default

Waiting...................
kemo0o is offline  
Old 6th April 2008, 12:22 AM   (permalink)
Default

Quote:
Originally Posted by kemo0o
Waiting...................
Yeah, aren't we all...

Really not to sure about it, need to think on it some. The buttons and resistors stick out as curious, not sure if it's right or wrong. I've only used switches. The program has an Rjmp instruction to a timer interrupt routine, which I didn't see. Maybe someone else will see the problem.

If you still suspect the chip, try reprogramming it with some simple code (flash an LED) that you already know works. Not familiar enough with the PWM stuff to know if that's correct.
HarveyH42 is offline  
Old 6th April 2008, 02:14 AM   (permalink)
Default

Have you tried posting your code on AVRfreaks?
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now  
Old 6th April 2008, 12:26 PM   (permalink)
Default

Quote:
Originally Posted by kemo0o
Waiting...................
Please see your schematic, I didn't find the crystal and associated pF capacitors/ Also I think you have to arrange for auto reset circuit element so that when the power is ON the circuit is reset after a while?
Please mod and then test. Let us see, whether it functions provided your software is correct.
__________________
Regards,
Sarma.
mvs sarma is offline  
Old 6th April 2008, 11:56 PM   (permalink)
Default

Solved ^_^ ....... ^_^
kemo0o is offline  
Old 7th April 2008, 12:01 AM   (permalink)
Default

Uh...............

What seems to be the officer problem?
Krumlink is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
What is a good AVR programmer with debug & HV programming? blueroomelectronics Micro Controllers 19 13th March 2008 02:53 AM
Connect two AVR kemo0o Micro Controllers 8 3rd March 2008 05:41 PM
AC Voltage Meter pursang General Electronics Chat 11 27th January 2008 02:34 PM
CodeVision AVR Help hitusharpatil Micro Controllers 12 22nd January 2008 05:10 AM
Eclipse IDE for ARM, AVR, and PIC? linuxguy Micro Controllers 9 29th September 2007 06:14 PM



All times are GMT. The time now is 05:33 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker