What is the most painless way to program a small micro for 2 PWM inputs and 2 PWM outputs? Logic would consist of timing and simple math manipulation of input to output. I can handle the hardware, but software is a foreign language. Would consider easy to impliment software or a low cost programming service. Comments and suggestions appreciated.
Painless micro program
May 17, 2007
64 Replies
How bad does this program need to be done ?
1) Take the cost of your time2) Guess how much time it would take _you_ to "program a small micro" and double it.
3) That would be your base line to start paying someone how knows what their doing to get it done.If you have the time and would like to learn how to do this yourself, I would suggest googleing for *** programmers and free *** software.
good luck
donald
PS: Don't let the CPU zelots tell you which is best, at your level any CPU will do to learn on.
*** = AVR, PIC, 8051, 6808, ARM, etc, etc, etc ........PPS: I like AVR :-)
Anybody got thoughts on AVR versus the TI MSP430? We're looking for a small, cheap, 14-pin-ish flash-based uP with adc's, essentially to manage a fancy solid-state relay. I think neither has hardware multiply in the low-end chips, but that's survivable. We're looking to digitize maybe 3 analog inputs and crunch an algorithm every 100 us or less, and do some serial control i/o, and the TI looks pretty good, fetching and executing an instruction word every clock.
John
I'd say the easiest (at least for me) has been by using a BASIC compiler. I use various Microchip PIC chips & PicBASICPro compiler -
formatting link
Several other BASICs are available, as well as some free & limited demo versions for the AVR's...
formatting link
formatting link
The code generated by the BASIC compilers is not as compact as well written assembly code - but the BASIC compilers make learning and using micros far easier.
Arch
That just proves you are silly. 8051's rule! :)
I think one of the best conplete development kits is the
formatting link
product.
AVRs have hardware multiply in the MEGA series, which are still quite cheap (Digi-Key shows the MEGA48 as $1.50 each in quantities of 100).
Not sure how MSPs compare to AVRs.
See, now the OP has done it.
The real zealots are coming out !!! ;-)
I forgot about MSP430's, I have been playing with a demo kit from TI and it is another good chip for my design arsenal.
donald
I can't at the moment recall a more repulsive architecture, excepting maybe the IBM 1401.
John
I was reading through the instruction set last night. It looks *very* PDP-11, nice and orthogonal, and things move in the proper direction
MOV.B SRC, DST
unlike certain bass-ackwards machines I could name. And they're working one level of deferral from what I'm used to,
JMP R5
I mean, how can you jump to a register? That's going to cause me trouble. The BIS/BIC/BIT opcodes are pure 11, although they added the AND, which the PDP-11 didn't have. But they use some weird names, like getting "branch" and "jump" totally backwards.
Too bad about the multiply. But we'll mostly be squaring (for RMS) and that can be finnessed.
John
AVR is much easier to program than MSP.
Just avoid the tinyAVRs if you want multiplier. QFN 32 is as small as SOIC-14.
Same for AVR.
I think that probably TI would be the best, but I don't think there are any showstopper issues with either one.
Best regards, Spehro Pefhany
"it\'s the network..." "The Journey is the reward"
speff@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
I am sure you are trying to program this is C.
TI has a trial version of their compiler on their web site. It will do upto 8K of code.
The CCE 2.0 also has a simulator in the package.
You might want to try their C compiler to see if it comes close to the
100uSec time required.There is also a 4K IAR compiler availabel from the same location.
formatting link
Please share what you find out, I would like to know how the CCE and IAR compilers compare in code size and speed.
donald
How about a LPC2101FBD48-S? under $2 in 100's. 7mm x 7mm. You would need a second voltage regulator. You can program it in assy if you want.
formatting link
Best regards, Spehro Pefhany
"it\'s the network..." "The Journey is the reward"
speff@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
I'm not. I like assembly, and the TI reminds me of the PDP-11. There
*are* machines I wouldn't dream of programming in assembly, of course.The cool thing about the TI is that every opcode fetch takes 62 ns, so you could practically measure execution times by taking a ruler to the assembly listing.
John
You are a real man John !!! ;-)
After looking over the assembly manual for the MSP430, I like it better than the AVR.
But, except for a few exceptions, I myself start with C and only go to assembly if it is really, really, really necessary.
good luck and have fun ( that's what its all about )
donald
CDP1802 has them all beat hands down.
Oh yeah, I'd repressed all my memories of that one.
John
Yeah but, back then Real Men programmed in "toggle". :-) Ed
I think it got designed in because it had a SEX instruction.
Good grief, I must be getting old, I've forgotten the Rim loader.
John
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required