Go Back   EcoModder Forum > EcoModding > Off-Topic Tech
Register Now
 Register Now
 

Reply  Post New Thread
 
Submit Tools LinkBack Thread Tools
Old 03-23-2008, 12:44 AM   #1 (permalink)
Master EcoModder
 
Join Date: Mar 2008
Location: Edmonton, AB, Canada
Posts: 531
Thanks: 11
Thanked 12 Times in 11 Posts
Microcontrollers

I posted the following question in the following thread but don’t want to hijack it further so I am reposting here:

Any interest in developing an open source fuel economy gauge/computer?

My apologies for a small hijack of the thread, but I am looking for some advice that is highly topic related. I have been looking to get into microprogramer like devices for quite a while now to do projects like this. I have a degree in Mech Eng and have taken classes in Electronics (analog) and some limited programming. I am looking for a good book or some websites that can get me started. I am not totally oblivious to the subject but have a couple of questions already.

Are they all programmed in C or C+ or do they use other languages and how do you know which one? Or is it all done by a compiler/assembler program?
I see different types like PLC, PIC, AVR, what are the differences and are there others?
Are they all burned with the same devices or is it manufacturer specific.
Some setups look like more complete boards than just chips, what are the differences/advantages?

I’m sure there are other people reading this thread that are highly interested in it as well and have similar questions. Maybe these sources/answers might be better replied to in a new thread in the “Off Topic Tech” section if someone is willing. Thanks

  Reply With Quote
Alt Today
Popular topics

Other popular topics in this forum...

   
Old 03-23-2008, 01:14 AM   #2 (permalink)
dcb
needs more cowbell
 
dcb's Avatar
 
Join Date: Feb 2008
Location: ÿ
Posts: 5,038

pimp mobile - '81 suzuki gs 250 t
90 day: 96.29 mpg (US)

schnitzel - '01 Volkswagen Golf TDI
90 day: 53.56 mpg (US)
Thanks: 158
Thanked 269 Times in 212 Posts
To be honest, I've never done this either. You might check with your local library, I just checked mine and was suprised to find a book about embedded communications(rs232/usb/serial) which is exactly the subject I've been wrestling with recently.

I believe the freeduino can be programmed by it's serial or usb port with some free software that you download and write your programs in (C based).


Also check out:
http://www.freeduino.org/

Especially read http://www.freeduino.org/files/ardui...ebook_v1-1.pdf , skip over all the C syntax stuff if you like but there are some handy functions that save you from most assembly language tasks and some good examples,

like analogRead(pin) returns 0-1023 but analogWrite(pin,value) will do PWM on the pin where 255 is a constant 5 volts.

And http://www.arduino.cc is a good resource
__________________
WINDMILLS DO NOT WORK THAT WAY!!!

Last edited by dcb; 03-23-2008 at 01:24 AM..
  Reply With Quote
Old 03-24-2008, 05:00 PM   #3 (permalink)
I"m not lurking!
 
s2man's Avatar
 
Join Date: Jan 2008
Location: Kansas City, MO
Posts: 128

Porthos - '96 Chevrolet Cavalier
90 day: 31.3 mpg (US)
Thanks: 0
Thanked 1 Time in 1 Post
Duff,
Sparkfun has a nice little tutorial which is geared more toward electronics, but uses the same processor as the Arduino boards for his lectures. Ladyada has an Arduino specific tutorial, which I'll be running through as soon as I get mine. And the Arduino site has a booklet which tries to cover everything. It gets spread a little thin, but has lots of links for more info.

From my industrial control days, a PLC can run up to $10,000 and have remote i/o, networking, etc. They are usually programmed with ladder logic, a visual language based on wiring diagrams which all the old maintenance men were used to reading. They can also be programmed with other languages. The programming software usually cost $ from the hardware mfr. I looked at using a a micro PLC first, since I am used to ladder logic. But by the time I added analog, high-speed counters, etc, the cost was around $300. And I still had to buy the software.

I'm new to microcontrollers, but I'll share what I've found so far (please correct me if I'm off base folks): The Atmel AVR and Microchip PIC microcontrollers seem to be the most popular. There are even clones of them available.

One of their websites claims you can program their chips with any language. But the reality seems to be you're pretty much limited by the availability of a compiler for each language. I've seen C, BASIC and one other language compilers. The Arduino platform has a free Development Environment supporting the Wiring language, which is a superset of C. You can also use straight C directly in it. AVR libraries and drivers are in C, so I think that pretty much limits the AVR programming to C. I would assume Arduino's could be programmed with other AVR tools (but you know what happens when you assume ) It looks like they use BASIC for the smaller PIC chips, and they use C on the bigger ones.

Atmel claims the same code will run on any chip in the AVR line. I'm not sure about PIC chips' portability.

It looks like we can use serial/usb to program the Arduino because there is already software installed (the bootloader) which will handle the communications. With no bootloader, or smaller boards with no serial/usb, the program gets loaded via the ttl port, which requires a "programmer" to convert RS232 to ttl. I know the small, popular BASIC Stamp PIC chip can be programmed on the Homework board through an RS232 connection, and it's programmed in P-BASIC (there's one on my desk ).

I hope that helps a little.
__________________
Roll on,
Stew

  Reply With Quote
Old 03-24-2008, 09:04 PM   #4 (permalink)
Lurking footless halls
 
Silveredwings's Avatar
 
Join Date: Dec 2007
Location: northeast
Posts: 249

Dark Horse - '16 Ford Mustang GT convertible Premium

Gutless Beauty - '19 Toyota Corolla SE
Thanks: 3
Thanked 3 Times in 3 Posts
How different is the arduino AVR (whatever it is) instruction set from the venerable 8051? There are so many examples (code and circuit), assemblers & compilers, and even open source software emulators for that series of chips.
__________________
Any sufficiently advanced technology is indistinguishable from magic. - Clarke's Third Law
  Reply With Quote
Old 03-24-2008, 11:01 PM   #5 (permalink)
Master EcoModder
 
Join Date: Mar 2008
Location: Edmonton, AB, Canada
Posts: 531
Thanks: 11
Thanked 12 Times in 11 Posts
Thanks for all the responses.
I have done a lot of searching since my post and I will share my findings
There are a few basic players in the processor industry and from what I have seen the PIC and AVR seem like the two worth pursuing (I think i'm going the AVR route).
http://en.wikipedia.org/wiki/Microcontroller had a good explanation of processor vs boards.
I think you can program in whatever language you want if you can find a compiler for it. C seems to be big for the AVR.
Coyote suggested a book but it was more than I wanted to spend, I found one for the AVR thats about half the cost:
http://www.amazon.com/AVR-Introducto...pd_sim_b_img_1

  Reply With Quote
Reply  Post New Thread


Thread Tools




Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Content Relevant URLs by vBSEO 3.5.2
All content copyright EcoModder.com