ultra-newbie: picking a first microcontroller?

I'd like to build an embedded device that takes in a thermocouple input, and then, if the temperature is below the user-specified set point, activates a relay (which would power an electric heater), and then, when the thermocouple senses the temperature has reached / is greater than the set point, de-energizes the relay.

I've got some experience with assembler (80386) and C.

I was thinking of going with the Atmel ATTINY12-8PC (only 8 pins, and a whopping 1kb of flash RAM, just $1.55 at Jameco), but then I read on the newsgroups that finding a programmer for this is impossible... is this true?

I've also heard that PIC's C tools are not free... is this still true, or has this changed?

The local junior college teaches a microcontrollers class, but alas, it is M/W 8am-noon, right when I have work. (This is a non-work-related hobby project, by the way.) I e-mailed the professor, and he gave me the book they use, but it seems they will be starting with the 8088...

Any suggestions, pointers? Would I be better off just buying a programmer, or could someone at my skill level assemble (no pun intended) my own?

Thanks...

Michael

Reply to
mrdarrett
Loading thread data ...

The HI-Tech PIC-C compiler is free for limited devices. I believe the Microchip PIC-18 C compiler is now essentially free, with only some minor limitations.

By far the easiest way to get into micros is with the PIC-AXE devices. No need for a programmer, programmed in BASIC, and you don't have to worry about all the little annoying traits of a particular micro and programmer . Using a programmer and C or assembler for a first timer can be really annoying. If it doesn't work first go becuase you got some configuration bit incorrect then it just sits there looking stupid at you until you magically figure it all out.

Once you have overcome the configuration bit/programmer hurdle though, that is the way to go. Only go with either PIC or Atmel AVR, there is just so much support out there for both of them. Each have their pros and cons.

Have fun.

Dave :)

Reply to
David L. Jones

No. I have one within arm's reach, a schematic somewhere on my hard drive, and know 2 places where I can purchase another tomorrow.

ATTINY12-8PI might be a better choice for your application, better heat tolerance.

seems a strange choice for the class, I guess it made sense when the hardware was purchased.

this schematic is AFAICT a clone of the Atmel STK200 in-circuit programmer, so it should be reliable, it can be made with inexpensive off-the-shelf parts and connects to the parallel port, it's powered by the circuit being programmed, download the stk200 manual from atmel.com for more info.

formatting link

NOTE: the original ISP used a 10-way IDC cable with one of the plugs on backwards!

Tell the programming software you're using a "STK200" programmer and it should work (I use uisp (linux software) but this hardware will also work with the windows stuff from Atmel too.)

I had a look at using C but the AVR assembler language is easy to use.

Bye. Jasen

Reply to
Jasen Betts

BASIC stamp, eh? Probably a good idea, come to think of it...

Thanks for the input.

Michael

Reply to
mrdarrett

I can recommend JAL (open source), and then specially v2, which will be launched within a week. Stef

Reply to
Stef Mientki

No, not the BASIC Stamp, the PIC-AXE. They are similar, but the PIC-AXE is cheaper and easier. BASIC Stamps are old hat.

Dave :)

Reply to
David L. Jones

Thanks again.

formatting link

Overclocking a PICAXE? Never would have crossed my mind... :)

Reply to
mrdarrett

The Picaxe has analogue capability.

You can try my completely free picaxe simulator from:

formatting link

to get an idea of what the picaxe types are and what functionality they support.

Mike Collier

Reply to
mrmichaelcollier

Thanks for that!

You know, I'm wondering where I can find a PICAXE. Jameco, Mouser and Digikey don't have them... is this something I have to order directly from the UK? (I'm in the States.)

Michael

Reply to
mrdarrett

if you don't mind some assembly i'd get the pickit2 from microchip, or from one of the distribution places that sells them. i think mine came from mouser but i can't be sure. anyway, get that and you have a chip to use, a programmer, and it's already hooked up to some led's, a switch, and it plugs into your computer via usb. couldn't be easier, just load up an example program, assembly it using the tools provided, load it into the chip using the tools provided, and hit the button that supplies power via usb to the chip. you'll have led lights blink'n before you know it, trivial.

and you can get some 8 pin (or bigger) pics and program them too. all they need to run is a program in them, 5 volts, and ground. you've got a working controller in 10 minutes.

the reason these are good for beginners is you get success out of the box and a place to expand using ultra simple tools and processes. you can immediately start adding functionality and focus on what you want to accomplish.

Reply to
purple_stars

United States suppliers of picaxe:

formatting link

Mike

Reply to
mrmichaelcollier

Wow, free shipping within the US!

Thank you...

Michael Darrett

Reply to
mrdarrett

I'd reccomend Microchip's PICKit2 also. It's a $50 fully assembled USB device with a little protoyping area that includes some LEDs and a trimpot, so you can get some instantly gratifying blinkenlights. They also give you a PIC16F690 with it, which is a rather nice microcontroller. You can program other PICs with it also, smaller and larger, just by wiring up a socket of the right size.

The other thing that's completely indispensable is PICBasic. It's not free, but it's worth every penny. You can do things like PWM and LCD control with only a couple lines of code. Multiply the amount of time that would take in assembly by your hourly wage and see if that's a bigger number than what they charge for PICBasic. :) There's also very good documentation and lots of sample code for it. This will run faster and leave more memory free than something like a basic stamp or PICAxe that's encumbered with an interpreter.

There's also a free program for compiling Python for PICs called Pyastra, which I'd like to try except that there's zero documentation for it.

snipped-for-privacy@gmail.com wrote:

Reply to
Eriswerks

Sounds more like a simple LM393 comparator and potentiometer plus some small-parts project to me! :-) With an uC you'd have to use an ADC to read out the thermocouple circuit voltage. A uC project could be more interesting, though.

There are very simple serial port programmers for attiny and atmega. There are also parallel port versions. Google for "Low Cost Programmer for AVR microcontroller", or see the stk200 manual link Jasen posted.

Then there's winavr / avr-gcc for the free unlimited C part.

If you've a more DIY approach and don't want a kit that includes all software and code that you could get elsewhere for free also, then

formatting link
has some relatively inexpensive nice starter boards or proto development boards for AVR, and MSP430 (has free msp-gcc C compiler, and one from TI). Just check that the respective uC has an ADC, for the thermocouple. Btw the msp430's would need some JTAG cable e.g. Olimex' MSP430-JTAG for programming, debugging, etc.

(Personally I'd go for JTAG programmable and debuggable devices, if free JTAG debugger tools are available as are e.g. for MSP430. In my experience all the programming and debugging via serial port stuff (ISP,...) usually just sucks, especially with respect to in-circuit "debuggability", whereas JTAG flash and in circuit debug with e.g. TI MSP430 and TI DSP's is very comfortable.)

Free but limited, though could be useable for your purposes.

Still, PIC architecture and opcode set sucks, severely, I'd never recommend these as a beginner project - especially not if you want to do assembler from a 80386 background. 386 assy is very nice and clean compared to PIC...

- Jan

Reply to
Jan Wagner

There's a whole lot of information here, I'll have to digest it slowly, thanks.

The PIC has a Harvard architecture, as does Atmel, right? (As opposed to the '386...) Is Atmel's assembler a little easier to learn/use?

I guess, in the long run, I'd be better off learning them both (PIC and Atmel)...

Thanks!

Michael

Reply to
mrdarrett

AVR asm and the instruction set is certainly more 386'ish than PIC. The assembly in AVR is much tighter than in PIC and I'd guess AVR asm is easier to learn and use, when you have 386 background. You'd miss quite a lot of 386 niceties in PIC (e.g. in PIC you'd have to cope with only one available register W, which is similar to AX but forget AH/AL)

Remainder of architecture, well, PIC and AVR are Harvard, but this alone does not say much except for the program and data memory bus split and possibly available separate instructions to access constant data from program memory. Harvard split memory access is done quite cleanly in AVR's, and a real mess in PIC's (with division into pages, banks, register file SRAM, ...). But then PICs are not all "PICs", there are several families e.g. PIC10, PIC12, ... , PIC24 that also differ in memory layout and more powerful instruction set.

Unfortunately, yes, that might be a good idea :-) Though not that I'd recommend PIC, no...

Something like PIC16F628 with UART and ADC could be relatively speaking nice for the temperature controller project, if you want to build things from scratch, without a starter kit.

- Jan

Reply to
Jan Wagner

Ooh, look what I found...

formatting link

Thanks for all the help...

Michael

Reply to
mrdarrett

Kewl! Thanks for reporting back!

Cheers! Rich

Reply to
Rich Grise

Any time!

Now I just have to figure out how to attach a parallel port cable to my breadboard... hmm...

Michael

Reply to
mrdarrett

Get a piece of ribbon cable, with an IDC DB-25M, and do this:

formatting link

But be careful to avoid this while tinning those #28 stranded wires:

formatting link

Have Fun! Rich

Reply to
Rich Grise

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.