EmbeddedRelated.com
Forums

Newbie help needed

Started by James Fraser October 2, 2007
Hi all,

I hope this is the appropriate group for my query. Quite a few seem
like they might fit: automation, robotics, &c. but I choose you guys,
because you're popular... (like high school all over...)

For my winter fun project I was thinking about attaching some "real
world" true analog gauges to my PC. On the PC side I will do some
scripting to scrape some HTML and determine how busy certain websites
are, and then adjust the needle on the gauge to match. so:

Requirements:
USB interface to PC,
Ability to control via script, possibly via compiled executables on
the PC.
Analog outputs,
a gauge or three (digi-key must have some, right? Grainger, I suppose
if not.)
Total cost < $100 (?)

I've got some (rusty) electronics background, and am comfortable with
a soldering iron.

My questions are mostly around the big issues:
What's the best architecture for this?
PC -> Microcontroller -> output ? or is there some way I can skip the
microcontroller?

How do I begin to decide what Microcontroller and dev environment to
use?
Seems like there are plenty of options. I don't have a clue on what I
care about or what I don't.
Recently I've been doing some high-level language stuff in Visual
Studio, but I know that's over kill for the code for this project.
For me, the fun of this project is really going to be on the PC side,
in the code to aggregate Web info and decide what analog values to
give that, so I'm trying to keep the PC to the display part of this as
simple as possible.

And down to the details:
I'd really like this to be controllable via USB. Is that adding too
much complication?


Any help or pointers to blogs/articles/anything greatly appreciated.
searches on PC USB and Gauge didn't really turn much up.


James Fraser

James Fraser wrote:
> Hi all, > > I hope this is the appropriate group for my query. Quite a few seem > like they might fit: automation, robotics, &c. but I choose you guys, > because you're popular... (like high school all over...) > > For my winter fun project I was thinking about attaching some "real > world" true analog gauges to my PC. On the PC side I will do some > scripting to scrape some HTML and determine how busy certain websites > are, and then adjust the needle on the gauge to match. so: > > Requirements: > USB interface to PC, > Ability to control via script, possibly via compiled executables on > the PC. > Analog outputs, > a gauge or three (digi-key must have some, right? Grainger, I suppose > if not.) > Total cost < $100 (?) > > I've got some (rusty) electronics background, and am comfortable with > a soldering iron. > > My questions are mostly around the big issues: > What's the best architecture for this? > PC -> Microcontroller -> output ? or is there some way I can skip the > microcontroller? > > How do I begin to decide what Microcontroller and dev environment to > use? > Seems like there are plenty of options. I don't have a clue on what I > care about or what I don't. > Recently I've been doing some high-level language stuff in Visual > Studio, but I know that's over kill for the code for this project. > For me, the fun of this project is really going to be on the PC side, > in the code to aggregate Web info and decide what analog values to > give that, so I'm trying to keep the PC to the display part of this as > simple as possible. > > And down to the details: > I'd really like this to be controllable via USB. Is that adding too > much complication? > > > Any help or pointers to blogs/articles/anything greatly appreciated. > searches on PC USB and Gauge didn't really turn much up. > > > James Fraser >
Find a microprocessor that has a USB interface and a PWM. Then make sure that there's lots of demo code for the USB -- I'd make it look like a serial port if I could, and send it text for the gauge. Then use the PWM as a cheezy DAC to drive the gauge -- with the right gauge you'll be able to do this from an RC filter from the micro. Analog gauges cost money -- check out the surplus houses like All Electronics, MPJA Associates, Herbach & Rademan, etc., for cheaper alternatives than new, name-brand analog meters. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" gives you just what it says. See details at http://www.wescottdesign.com/actfes/actfes.html
On Oct 2, 4:55 pm, Tim Wescott <t...@seemywebsite.com> wrote:
> > Find a microprocessor that has a USB interface and a PWM. Then make > sure that there's lots of demo code for the USB -- I'd make it look like > a serial port if I could, and send it text for the gauge. > > Then use the PWM as a cheezy DAC to drive the gauge -- with the right > gauge you'll be able to do this from an RC filter from the micro. >
Thanks for the advice and the warning. It seems like there are a lot of options for microprocessors/controllers, even when I filter for USB and PWM. Is there any place to get reviews or comparisons of these? I know that a lot of it will be personal preference, but right now, I don't think I have any. Is there a particularly popular architecture or dev environment that might be a safe bet to get me started? Maybe I should start with a book or some website reading? Feeling lost in the number of options... James Fraser
James Fraser wrote:
> On Oct 2, 4:55 pm, Tim Wescott <t...@seemywebsite.com> wrote: >> Find a microprocessor that has a USB interface and a PWM. Then make >> sure that there's lots of demo code for the USB -- I'd make it look like >> a serial port if I could, and send it text for the gauge. >> >> Then use the PWM as a cheezy DAC to drive the gauge -- with the right >> gauge you'll be able to do this from an RC filter from the micro. >> > > Thanks for the advice and the warning. It seems like there are a lot > of options for microprocessors/controllers, even when I filter for USB > and PWM. Is there any place to get reviews or comparisons of these? I > know that a lot of it will be personal preference, but right now, I > don't think I have any. Is there a particularly popular architecture > or dev environment that might be a safe bet to get me started? > > Maybe I should start with a book or some website reading? >
It's hard to go wrong with Microchip, if you don't mind assembly language programming. Those 35 easy-to-remember instructions can make your code rather bizarre at times, but you can get the job done. If you are more comfortable in C it's easier to get a free compiler for an AVR, and _much_ easier to get a compiler that's fairly ANSI compliant. However, I don't know how the AVR is for the USB thing. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" gives you just what it says. See details at http://www.wescottdesign.com/actfes/actfes.html
"Tim Wescott" <tim@seemywebsite.com> wrote in message 
news:WfGdnZ7yZI9NIJ_anZ2dnUVZ_qLinZ2d@web-ster.com...
> James Fraser wrote: >> Hi all, >> >> I hope this is the appropriate group for my query. Quite a few seem >> like they might fit: automation, robotics, &c. but I choose you guys, >> because you're popular... (like high school all over...) >> >> For my winter fun project I was thinking about attaching some "real >> world" true analog gauges to my PC. On the PC side I will do some >> scripting to scrape some HTML and determine how busy certain websites >> are, and then adjust the needle on the gauge to match. so: >>
<Snip>
>> >> And down to the details: >> I'd really like this to be controllable via USB. Is that adding too >> much complication?
Are you really sure you want USB? Serial would be far easier to implement and significantly widens the choice of microcontrollers available. You're not going to need to shift data to the gauge controller at very high speeds.
>> Any help or pointers to blogs/articles/anything greatly appreciated. >> searches on PC USB and Gauge didn't really turn much up. >> >> >> James Fraser >> > Find a microprocessor that has a USB interface and a PWM. Then make > sure that there's lots of demo code for the USB -- I'd make it look > like a serial port if I could, and send it text for the gauge. > > Then use the PWM as a cheezy DAC to drive the gauge -- with the right > gauge you'll be able to do this from an RC filter from the micro.
That's good advice but, as I said before, if you use serial then the port will already look like a serial port. Plus you could pick a micro that has a built in DAC to avoid the PWM aspect but it won't be as much fun or as educational. Of course, a USB solution provides power as well.
> Analog gauges cost money -- check out the surplus houses like All > Electronics, MPJA Associates, Herbach & Rademan, etc., for cheaper > alternatives than new, name-brand analog meters.
They needn't cost much. An el cheapo analog multimeter could be canibalised or there will be many suitable gauges in a car junkyard. Although in retrospect there may be an issue in finding 12V. A temperature gauge gives you reds and greens which would translate nicely enough to web activity.
"James Fraser" <jbf1@concentric.net> skrev i meddelandet 
news:1191377452.336002.223470@19g2000hsx.googlegroups.com...
> On Oct 2, 4:55 pm, Tim Wescott <t...@seemywebsite.com> wrote: >> >> Find a microprocessor that has a USB interface and a PWM. Then make >> sure that there's lots of demo code for the USB -- I'd make it look like >> a serial port if I could, and send it text for the gauge. >> >> Then use the PWM as a cheezy DAC to drive the gauge -- with the right >> gauge you'll be able to do this from an RC filter from the micro. >> > > Thanks for the advice and the warning. It seems like there are a lot > of options for microprocessors/controllers, even when I filter for USB > and PWM. Is there any place to get reviews or comparisons of these? I > know that a lot of it will be personal preference, but right now, I > don't think I have any. Is there a particularly popular architecture > or dev environment that might be a safe bet to get me started? > > Maybe I should start with a book or some website reading? > > > Feeling lost in the number of options... > James Fraser >
If you go with an ARM, you have the advantage that the demo compilers (IAR etc.) are for free, up to 32 kB of code, which looks more than sufficient for your needs. If you go with an 8 bit chip, then your free choices are normally limited to about 2-4 kB which is probably not sufficient. Atmels AT91SAM7S321 has an ARM7TDMI core USB and there is an USB CDC (Communication Device Class) driver for it free of charge. You can program the device using a serial port or USB. -- Best Regards, Ulf Samuelsson This is intended to be my personal opinion which may, or may not be shared by my employer Atmel Nordic AB
Tim Wescott wrote:
> James Fraser wrote: >> On Oct 2, 4:55 pm, Tim Wescott <t...@seemywebsite.com> wrote: >>> Find a microprocessor that has a USB interface and a PWM. Then make >>> sure that there's lots of demo code for the USB -- I'd make it look like >>> a serial port if I could, and send it text for the gauge. >>> >>> Then use the PWM as a cheezy DAC to drive the gauge -- with the right >>> gauge you'll be able to do this from an RC filter from the micro. >>> >> >> Thanks for the advice and the warning. It seems like there are a lot >> of options for microprocessors/controllers, even when I filter for USB >> and PWM. Is there any place to get reviews or comparisons of these? I >> know that a lot of it will be personal preference, but right now, I >> don't think I have any. Is there a particularly popular architecture >> or dev environment that might be a safe bet to get me started? >> >> Maybe I should start with a book or some website reading? >> > It's hard to go wrong with Microchip, if you don't mind assembly > language programming. Those 35 easy-to-remember instructions can make > your code rather bizarre at times, but you can get the job done. > > If you are more comfortable in C it's easier to get a free compiler for > an AVR, and _much_ easier to get a compiler that's fairly ANSI > compliant. However, I don't know how the AVR is for the USB thing. >
Not Quite Microchip's PIC18 USB chips use a C language library. The old PIC16C745 is OTP, but was done in ASM.
On Oct 3, 3:40 am, "Tom Lucas"
<news@REMOVE_tlcs_THIS_dot_TO_fsnet_REPLY_dot_co.uk> wrote:
> "Tim Wescott" <t...@seemywebsite.com> wrote in message >
> > Are you really sure you want USB? Serial would be far easier to > implement and significantly widens the choice of microcontrollers > available. You're not going to need to shift data to the gauge > controller at very high speeds. > > >> Any help or pointers to blogs/articles/anything greatly appreciated. > >> searches on PC USB and Gauge didn't really turn much up. > > >> James Fraser > > > Find a microprocessor that has a USB interface and a PWM. Then make > > sure that there's lots of demo code for the USB -- I'd make it look > > like a serial port if I could, and send it text for the gauge. > > > Then use the PWM as a cheezy DAC to drive the gauge -- with the right > > gauge you'll be able to do this from an RC filter from the micro. > > That's good advice but, as I said before, if you use serial then the > port will already look like a serial port. Plus you could pick a micro > that has a built in DAC to avoid the PWM aspect but it won't be as much > fun or as educational. Of course, a USB solution provides power as well.
Thank you all for the input, it's been very helpful: In doing a moderate amount of reading and research yesterday, I changed direction a little bit: -It looks like USB interfaces aren't as straightforward as I would have hoped. Drivers for the Host PC, and lots of room for problems. -Ethernet and IP for microcontrollers seems a lot more mature than I expected. Right now I'm leaning towards this for the interface to the PC. Script on PC sends command (via IP/http or UDP maybe.) microcontroller gets command and uses i2c serial bus to a DAC to set voltage out. This seems to give an easier, more general (less configuration) interface to the PC. and if I read things right, I think I could put in multiple i2c DAC's for separate gauges. I would like to keep circuit dev time to a minimum. For me, the big fun will be in deciding which and how much information to aggregate to the gauges. (i.e. how could server health be summarized with a single number? It's not an average, because when disk used goes from 90% to 100%, the server health needs to go from medium to terrible.) So now I'm looking at netburner or microchip ethernet development boards. They are above my original budget, but look like they should get me up and going quickly. Thanks again all for the help. James Fraser
James Fraser wrote:

> > Thank you all for the input, it's been very helpful: > In doing a moderate amount of reading and research yesterday, I > changed direction a little bit: > -It looks like USB interfaces aren't as straightforward as I would > have hoped. Drivers for the Host PC, and lots of room for problems. > -Ethernet and IP for microcontrollers seems a lot more mature than I > expected. Right now I'm leaning towards this for the interface to the > PC.
Ethernet has a much longer 'reach' - USB only handles short desktop cables.
> > Script on PC sends command (via IP/http or UDP maybe.) microcontroller > gets command and uses i2c serial bus to a DAC to set voltage out. > This seems to give an easier, more general (less configuration) > interface to the PC. and if I read things right, I think I could put > in multiple i2c DAC's for separate gauges. > > I would like to keep circuit dev time to a minimum. For me, the big > fun will be in deciding which and how much information to aggregate to > the gauges. (i.e. how could server health be summarized with a single > number? It's not an average, because when disk used goes from 90% to > 100%, the server health needs to go from medium to terrible.) > > So now I'm looking at netburner or microchip ethernet development > boards. They are above my original budget, but look like they should > get me up and going quickly.
Or this from SiLabs ? http://www2.silabs.com/tgwWebApp/public/web_content/products/Microcontrollers/Interface/en/CP2201EK.htm -jg
"James Fraser" <jbf1@concentric.net> wrote in message 
news:1191515760.063797.325520@g4g2000hsf.googlegroups.com...
> On Oct 3, 3:40 am, "Tom Lucas" > <news@REMOVE_tlcs_THIS_dot_TO_fsnet_REPLY_dot_co.uk> wrote: >> "Tim Wescott" <t...@seemywebsite.com> wrote in message >> > >> >> Are you really sure you want USB? Serial would be far easier to >> implement and significantly widens the choice of microcontrollers >> available. You're not going to need to shift data to the gauge >> controller at very high speeds. >> >> >> Any help or pointers to blogs/articles/anything greatly >> >> appreciated. >> >> searches on PC USB and Gauge didn't really turn much up. >> >> >> James Fraser >> >> > Find a microprocessor that has a USB interface and a PWM. Then >> > make >> > sure that there's lots of demo code for the USB -- I'd make it look >> > like a serial port if I could, and send it text for the gauge. >> >> > Then use the PWM as a cheezy DAC to drive the gauge -- with the >> > right >> > gauge you'll be able to do this from an RC filter from the micro. >> >> That's good advice but, as I said before, if you use serial then the >> port will already look like a serial port. Plus you could pick a >> micro >> that has a built in DAC to avoid the PWM aspect but it won't be as >> much >> fun or as educational. Of course, a USB solution provides power as >> well. > > Thank you all for the input, it's been very helpful: > In doing a moderate amount of reading and research yesterday, I > changed direction a little bit: > -It looks like USB interfaces aren't as straightforward as I would > have hoped. Drivers for the Host PC, and lots of room for problems. > -Ethernet and IP for microcontrollers seems a lot more mature than I > expected. Right now I'm leaning towards this for the interface to the > PC.
Ethernet isn't much less complicated than USB, although if you pick your device carefully there may well be some open source software already written. Check out the sort of things supported by FreeRTOS. However, I would still maintain that simple serial is going to present with the shortest development time and there is code galore all over the internet to get you up and running.
> Script on PC sends command (via IP/http or UDP maybe.) microcontroller > gets command and uses i2c serial bus to a DAC to set voltage out. > This seems to give an easier, more general (less configuration) > interface to the PC. and if I read things right, I think I could put > in multiple i2c DAC's for separate gauges.
I2C only needs the one bus if you are careful with your addressing so you'll save effort on PCB layout and part count.
> I would like to keep circuit dev time to a minimum. For me, the big > fun will be in deciding which and how much information to aggregate to > the gauges. (i.e. how could server health be summarized with a single > number? It's not an average, because when disk used goes from 90% to > 100%, the server health needs to go from medium to terrible.)
Perhaps ping someone from time to time and gauge how long the response takes? Might give a jumpy gauge though.
> So now I'm looking at netburner or microchip ethernet development > boards. They are above my original budget, but look like they should > get me up and going quickly. > > > Thanks again all for the help. > James Fraser >