[SOLVED] Basic uC question regarding difference of 8bit, 10bit & 12bit controllers.

Status
Not open for further replies.

David_

Advanced Member level 2
Joined
Dec 6, 2013
Messages
573
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,308
Location
Sweden
Visit site
Activity points
12,242
Basic uC question regarding difference of 8bit and 32bit controllers.

I am designing a adjustable dual rail tracking lab supply and I've decided to go with the idea to regulate the voltage with a filtered PWM signal, the max output voltage is 25V and a 8bit controller does not give me enough resolution.

I did learn a little about micro-controller a couple years ago but I have not worked much with micro-controllers and I have just begun learning C++(not optional) and after a lot of work i did manage to program a couple controllers with AVRdude but 8-bit controller will not do.

I'm a electronics engineer student but software is not something i have a good grasp of and I have no clue what a 32bit micro-controller would require in order to interface and program it via usb relative to a 8-bit, I've used AVR without any reason and i have a understanding for the interface structure of 8-bit AVR controllers but I have no objection to other uC's.

Is it a realistic goal to interface and program a AVR 32-bit controller homebrew style?
Or do i need to invest in a real programmer?
I will buy one in the end but i can't afford one for the moment, but i have acces to a Seriel port through USB dongel.

Is there any alternative in order to get a lot more then 256 steps in the PWM resolution?
 
Last edited:

Hello,

Some clarification first.

8bit controller does not give me enough resolution
Are you talking about your PWM resolution? You can get better 8bit microcontrollers that have a higher resolution DAC output. An 8bit microcontroller only refers to how it handles it's data internally (how many operations it can do per cycle). So that's why the theory is the higher the bits the faster the controller because it can pack in more commands per cycle. So a higher than 8 bit DAC output would just use 2 registers to combine for the output. AT90PWM216 is an example that uses a 10bit but you can pretty much go to digikey and under data converters look for anything that says D/A x 10B and that will give you a higher resolution.

8-bit controller will not do
The Arduino wouldn't work in this case but I would look into it to help you learn about programming and give you a nice option on a controller. It is a 8bit Atmega that has a bootloaded software on top of it. Very high level programming and fast development. The board is about $25 and you can buy the DIP one if you wanted to program the chip and take it off the board (of there is ICSP options).

Is it a realistic goal to interface and program a AVR 32-bit controller homebrew style?
Yes, people do it all the time! Honestly the hardest part is interfacing to them because they usually are SMD chips. So that means you either have to make a PCB and send it out or you have to order a dev board (not a bad idea to start with, would have USB interface as well). The big difference is when you are programming you need to find a 32bit compiler that works for your controller.

Sounds like you just need the right controller with a higher DAC resolution so try that search first.
 

Aha i see my missconception, thanks for the explanation.

I have a couple ATmega328 with bootloader and i found some information online about using Timer1 and some Arduino library in order to get 10bit resulotion PWM.
My first practical goal is to succesfully program a variable and as perfect as possible DC voltage controlled with a rotary encoder through a uC, any rippel on the variable filtered DC output will translate on to the regulator output so I will be very thourough. It is no problem if the voltage takes a split second to follow the adjustment as long as the output is really clean.

Outside of the function of using a uC to manage voltage and current regulation for a power supply i really need to get a firm understanding for microcontroller structure and i will need(in the end) to learn both C++ and asembler and although Arduino bootloader has enabled me to acctualy program controllers and use them it allows me to do something without any clue of how i did it.
I think i will use Arduino in order to get a initial understanding for PWM, ADC and DAC.

As I in the end need to understand the complete process of interfacing, communicating and programing uC's, would you think that i would struggle more if i would set my eyes on a 32bit controller?
PCB design and home production(harware in generall) is not a concern but regarding a complete beginner trying to grasp the generall concept.
On one hand the goal is to enable me to expand my intresse and posebilities for my own personel design adventures but in the end the experience will hopfully help me in regards to future proffesional ventures.

On my free time I spend lots of time dissesembling and reusing all kinds of electronic devices and all uC i come accros sudgest to me that i will need to go beond 8bit, if so i guese I'm contemplating if it is adviseble to start with 8bit dip AVR's and then go on to 32bit or if i might as well go for 32bit to begin with?

Theres a awful many things to get my head around, my thoughts is all over the place thanks to ADD and if you have any sudgestions i could really benefit from getting some guidence.

Regards
 

would you think that i would struggle more if i would set my eyes on a 32bit controller?

Once you learn C you shouldn't have any problems. Most of the compilers have a set of header files to map the registers to the location for you so it is just setting and reading variables for the most part.

start with 8bit dip AVR's and then go on to 32bit or if i might as well go for 32bit to begin with?
It really should be about the same learning curve. Either way to start with simple codes to learn it. Can I turn on the LED? Can i read this signal? Can I sleep the timer? Can I use communication? Just baby steps.

I was in a similar boat as you. I am an electrical engineer that has been mainly placed in hardware positions. I did a fair amount of programming through high school and college and enjoy it so I tried carrying it over. I had a hard time picturing what was going and how things work for C programming and microcontrollers. I learned a lot from my embedded class in my master's program that I am in. All the information is out there it's just making it relatable in terms you understand. It's just basic program structure and how to access and write to different things on the controller.
 

Thanks, simple but o so good advice.

I've gotten my hands on a Arduino Mega2560 but although it's very convenient to interface and learn some basics I'm wonder if it might be confusing learning to use the IDE, I know that it is based on C/C++?

I might go with the idea to learn C++ by programing exercises and parallel to that use Arduino to explore the basic uC structure.

In your experience, is there a middle ground between hardware and software or do you do one or the other. professionally?

//update

I might get ahead of my self a little but i found out about a 16bit PWM controller TLC5940 that can be controlled with a uC, does it not provide a simple and effective compromise?

I have begun to read about ADC and all that so we shall see.
 
Last edited:

I've gotten my hands on a Arduino Mega2560 but although it's very convenient to interface and learn some basics I'm wonder if it might be confusing learning to use the IDE, I know that it is based on C/C++?

The IDE enables you simple control of the controller without having to deal with the bits and registers directly. So for fast prototyping and a decent range of capability the Arduino is a good solution. The IDE is based on a version of "basic" that uses simple keywords for control and does allow you to import the AVR library for C commands and direct control.

I might go with the idea to learn C++ by programing exercises and parallel to that use Arduino to explore the basic uC structure.
C is the language that most compilers use programming. C is pretty much C++ without the object/class abilities.

In your experience, is there a middle ground between hardware and software or do you do one or the other. professionally?
I do both of them in my profession but that is always a considerations in our designs. If there is a solid architecture that can be done with hardware, why complicate it with software? But there is a balance and pros and cons on when to do embedded systems and how much power to give the controller (safety and system checks).

I might get ahead of my self a little but i found out about a 16bit PWM controller TLC5940 that can be controlled with a uC, does it not provide a simple and effective compromise?

I have used these before with the Arduino to do RGB LED control and multiplexing. They are good chips and easy to use. The Arduino has a library available for it to implement the solution. But obviously you can do the same things with any of the controllers. You just need to know serial communication to talk to the controller (Clock, Data, Latch). I would recommend getting samples as they are not the cheapest chips.
 

I have started to correct my missgivings about the subject of programing and bits and allthoug i can't wright i explenation i will mark this as solved seeing how i have gotten the right guidence and can continiue the project that sparked the query.

Thanks for the help, best wishes.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…