EcoModder.com

EcoModder.com (https://ecomodder.com/forum/)
-   Off-Topic Tech (https://ecomodder.com/forum/off-topic-tech.html)
-   -   Microcontrollers (https://ecomodder.com/forum/showthread.php/microcontrollers-1516.html)

Duffman 03-23-2008 12:44 AM

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

dcb 03-23-2008 01:14 AM

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

s2man 03-24-2008 05:00 PM

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.

Silveredwings 03-24-2008 09:04 PM

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.

Duffman 03-24-2008 11:01 PM

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


All times are GMT -4. The time now is 01:06 AM.

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