8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
nuRuL
Thu Apr 17 2008, 04:23AM
 User Offline
Registered Member #6189
Joined: Thu Feb 21 2008, 05:53AM

Posts: 8
Thanked 0 times in 0 posts

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


Back to top


Ajay
Thu Apr 17 2008, 06:22AM
Rickey's World Admin

 User Online

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3375
Thanked 616 times in 583 posts
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.

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top



This post has been thanked 1 time
 nuRuL 
nuRuL
Thu Apr 17 2008, 08:12AM
 User Offline
Registered Member #6189
Joined: Thu Feb 21 2008, 05:53AM

Posts: 8
Thanked 0 times in 0 posts
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.
Back to top


sashijoseph
Thu Apr 17 2008, 02:52PM

 User Offline
Registered Member #5870
Joined: Mon Feb 04 2008, 06:26PM

Posts: 471
Thanked 106 times in 101 posts
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?

Let there be music........
Back to top



This post has been thanked 1 time
 nuRuL 
nuRuL
Fri Apr 18 2008, 10:02AM
 User Offline
Registered Member #6189
Joined: Thu Feb 21 2008, 05:53AM

Posts: 8
Thanked 0 times in 0 posts
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.
Back to top


sashijoseph
Fri Apr 18 2008, 03:14PM

 User Offline
Registered Member #5870
Joined: Mon Feb 04 2008, 06:26PM

Posts: 471
Thanked 106 times in 101 posts
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.

Let there be music........
Back to top



This post has been thanked 1 time
 nuRuL 
nuRuL
Tue Apr 22 2008, 10:49PM
 User Offline
Registered Member #6189
Joined: Thu Feb 21 2008, 05:53AM

Posts: 8
Thanked 0 times in 0 posts
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?
Back to top


Ajay
Wed Apr 23 2008, 02:12AM
Rickey's World Admin

 User Online

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3375
Thanked 616 times in 583 posts
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..

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top



This post has been thanked 1 time
 nuRuL 
 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems