Discussion in "AVR Discussion Forum" started by    nuRuL    Apr 17, 2008.
Thu Apr 17 2008, 04:53 pm
#1

Hi

Im actually designing a Switch Mode Power Supply circuit.
I then would like to apply a digital control at the feedback loop using an AVR.
This is to smooth out the output signal, getting rid of the ripples and such to prove that a digital control over analog is more reliable and useful.
However, I was before using an ATmega169 on Butterfly board which now I found too complicated for a simple program like mine.
I feel like avoiding the hassle and turn to something smaller and simpler.
So do I use a Tiny AVR? If so, how do I choose which to use as there are too many of them or which one would u suggest?

My analog circuit (SMPS) basically contains:
# 3.0V input voltage from power supply
# 10kHz 6.0V pk-pk squarewave signal from signal generator
# around 5.8V output voltage (which Im gonna lower down with a potential divider before putting it into an ADC)

Really hope u could help. Thanks.


Nurul
Thu Apr 17 2008, 06:52 pm
#2
tiny avr will do the job..
why to use a development board when you can use a smaller controller and make a clean and simple stand alone board.
 nuRuL like this.
Thu Apr 17 2008, 08:42 pm
#3
Oh really..
Cos before this I thot using ATmega169 is much easier as it already comes in a package with its Butterfly board.
Been stucked with this Butterfly for ages now.
But I think I'll stick with the Butterfly first and see whats gonna happen cos my deadline is very close already.

And one more thing, as on the Butterfly, we can only get access to limited pins of the AVR right?
Ive read somewhere that I could actually replace the ports available to get access to what is not.
Say now I would like to access to PORTF cos I have analog input to be fed to the internal ADC.
I read somewhere that I could actually use the JTAG ports as ADC[4:7] if JTAG is not being used.
And yes in my case, Im not using the JTAG ports.
But how do I do that? I mean how do I get access to the ADC[4:7] through the JTAG ports? Codewise?

Many thanks in advance.
Fri Apr 18 2008, 03:22 am
#4
To gain access to the PF4:PF7 as ADC you need to disble JTAG.This is done by disabling the JTAGEN fuse bit.
Programming fuse bits is possible only through a serial (or parallel) programmer.If your Butterfly board has a ISP header you can connect it to a serial programmer for fuse bit programming.
Even with he JTAG enabled you still have 4 ADC channels available.Why not use them?
 nuRuL like this.
Fri Apr 18 2008, 10:32 pm
#5
What do u mean by even with the JTAG enabled I could still use that 4 ADC channels? How do I do that?
Plus do I actually need JTAG for my butterfly? What is it for actually?

I basically need to access PORTF of the butterfly to feed my analog output from an external circuit to be converted using the ADC.

Many thanks in advance.
Sat Apr 19 2008, 03:44 am
#6
See out of the 8 PortF pins only 4 are used for JTAG(ie PF4:PF7).The rest PF0-PF3 can be used as normal I/O pins or as ADC pins.
JTAG can be used for programming the chip or for On-chip Debugging.
 nuRuL like this.
Wed Apr 23 2008, 11:19 am
#7
manythanks for those info
ive one more question

say i have done my coding for PWM on timer/counter0
the output should be on OCR0 which is PB4 (according to ATmega169 pinout)
but im using my school's development board and PORTB is not connected
so my Q is how do i do the code to make PORTD to output whats on PB4?
Wed Apr 23 2008, 02:42 pm
#8
PWM works in background..

well you can do this way... when compare occurs interrupt is generated and whenever interrupt occurs change state of pin.. that is all i can say right now..
 nuRuL like this.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am
Robertphype
Sat Apr 27 2024, 12:23 am
ktaletrryp
Fri Apr 26 2024, 10:55 pm
Robertrip
Fri Apr 26 2024, 11:20 am