Forum Replies Created
-
AuthorPosts
-
Ghulam Mustafa
ParticipantGhulam Mustafa
ParticipantHello,
I have found this program and is working wel for AVR ATmega16 for ADC conversion and wanted to share
I found it in Avr Microcontroller’s Book by Mazidi.INCLUDE “M16DEF.INC”LDI R16,0xFFOUT DDRB,R16OUT DDRD,R16LDI R16,0OUT DDRA, R16LDI R16,0x87OUT ADCSRA,R16LDI R16,0xC0OUT ADMUX, R16READ_ADC:SBI ADCSRA,ADSCKEEP_POLING:SBIS ADCSRA,ADIFRJMP KEEP_POLINGSBI ADCSRA,ADIFIN R16,ADCLOUT PORTB,R16IN R16,ADCHOUT PORTD,R16RJMP READ_ADCGhulam Mustafa
ParticipantAn important observation:
When the input voltages are less than 2V this error doesnt occour!
Ghulam Mustafa
Participanti think that the coder has send all the 10 bits to port b this is the reason that the port is flashing. What do you ppl think?
Ghulam Mustafa
ParticipantI have added 4Mhz crystal now, but still facing the same error.
I have tried some other program which is running correctly.
So the problem, i think is in the code. http://www.engineersgarage.com/embedded/avr-microcontroller-projects/adc-circuit
Kindly check it and inform me, why the ports are continously blinking.
Thanks
Ghulam Mustafa
ParticipantThanks very much
Two thinks to ask before implementing.
1- this program was simulated on Proteus and was running well without the oscillator
2- Is there any prblem in the fuse bits
Pls reply so that i may implement it now
Ghulam Mustafa
ParticipantHello Amrith
Thanks for replying, i have mentioned the link which i am following to develop the circuit. Actually i doesnt contain any external oscillator.
Thanks
Ghulam Mustafa
Participantwysiwyg_imageupload:5162:Hello,
I am using the following cofiguration for the atmega16 controller.
I think that the last reason may be this issue.
Kindly check and inform if this is the main issue.
Thanks
Ghulam Mustafa
ParticipantI tried it all but the program is not running. Also when i simulated the circuit in Proteus it is working correctly, while not on the bread board.
Also another simple circuit has the same problem
Pls guide what migt be the problem and how it could be resolved.
Thanks
Ghulam Mustafa
ParticipantThanks alot,
I compiled and burn the program on the chip, i am facing a problem that the LED present at the output are continously blinking if i provide some voltage on the adc pin, otherwise if i connect this pin to VCC or GND, they are continously high or low.
Pls guide what could be the problem now.
Thanks again
Ghulam Mustafa
ParticipantThanks alot
I have programmed the AVR, http://www.engineersgarage.com/embedded/avr-microcontroller-projects/adc-circuit but LED’s are flashing continously, while when i switch them to Gnd all are Off, and when Vcc is supplied all are High.
While when connected to Pot, they flash with different values.
What might be the problem now?
-
AuthorPosts