×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Getting into micros, need a chip to start

Getting into micros, need a chip to start

Getting into micros, need a chip to start

(OP)
Hello all.  

I am looking to convert a logic system into a micro based board.  From what I have learned about the process, I'd like to use C and write some code on Xcode (OS X), then test it with a USB connection to make some leds turn on and off.  I am looking to find a simple chip to start on, maybe 12-15 inputs, 10 outs or so.  I have someone to help me get going with the language to get my feet wet, but will likely do some consulting to speed  up the curve.  If you've used a specific chip and have a part number you like that would be great,

I have a PC also, so that is a second choice for interfacing and writing the program.

Functiionally, it needs to see 5 volt inputs from a number of sources and respond with various outputs based on the code.  I have heard this should be easy to implement, especially since there is a working logic based board to emulate.

Thanks


Todd Chapman

RE: Getting into micros, need a chip to start

You have about four choices.
Get a microchip development board.
Get an Atmel development board.
Get a Zilog development board.

Or much easier get a PICSTAMP and do this all with Basic or some other higher language.

Oh and totally ditch that Mac as I cannot imagine a single C compiler or Integrated Development Environment that runs on a Mac.

Engineers use PCs, artists use Macs.

Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com

RE: Getting into micros, need a chip to start

(OP)
Hello again itsmoked

I am reading through all the lit you mentioned before about parallax.  Just digging  into it, the picstamp looks like the way to go.  I am really looking forward to figuring it out.

RE: Getting into micros, need a chip to start

Here are several you may want to look at.

http://www.micromint.com/products/bolt.htm
http://cubloc.com/product/01_01cb220.php
http://jstamp.systronix.com/jstamp_photos.htm
http://www.bagotronix.com/dosstamp.html
and of course:
http://www.parallax.com/html_pages/products/basicstamps/basic_stamps.asp

These will give you instant gratification compared to slogging thru C and the tools required to develop with it.

Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com

RE: Getting into micros, need a chip to start

(OP)
I ordered some Parallax parts, the 32 i/o  BS2P40 and the demo board.  Should be fun to get into it.  The PBasic doesn't seem too intimidating.  They have their software for both PC and Mac so I can use either one.


Thanks for the tips!

RE: Getting into micros, need a chip to start

If you really want to get involved with the hardware, some of the old 8-bit microprocessors without any integrated support IC's are worth playing with:

i) Thy're muck cheap, so you can blow 'em up a couple of times and not feel guilty.
ii) They work in breadboard lash-ups.
iii) They make you do everything yourself, so you learn.

The 6809 or the 68008 would be work a look at. The 68008 is a nicer chip to program in assembler. The old Z80 is another possibility.

----------------------------------
  I don't suffer from insanity. I enjoy it...

RE: Getting into micros, need a chip to start

The 6809 is found inside the Tandy Radio Shack Color Computers (CoCos). Dime a dozen these days (seriously, maybe $5 each). They even used to sell an Editor/Assembler cartridge for working at that level.

Not exactly up-to-date but very easy to work with and with a extremely gentle learning curve.

RE: Getting into micros, need a chip to start

If you decide to have a ply with the 6809, an excellent book is "Programming the 6809" by Rodnay Zaks and William Labiak. This was the first processor I learned on - the book made things much easier to understand. It is from 1982, so it might be a little hard to find these days.

----------------------------------
  I don't suffer from insanity. I enjoy it...

RE: Getting into micros, need a chip to start

(OP)
Thanks for the suggestions on  the 6809,  I used to have one of those computers by Tandy back in the day.  I have already ordered some Parallax parts and spent a lot of time reseraching that route, so for now I'll have to see where that leads.  So far, as a new guy, I am really liking the Parallax site.  The ethernet connectivity is already worked out really nicely with their systems as well.  Buying OEM parts to embed their stamp into my own system is under 20 bucks.  

Thanks again fellows

RE: Getting into micros, need a chip to start

Nobody makes 6809s any more :o(.

I would have thought that the Microchip PIC is the way to go.

Hideous architecture, but it does work.

And reasonably cheap.

Free tools (assembler) from the Microchip site.

RE: Getting into micros, need a chip to start

Man, I am getting old!

----------------------------------
  I don't suffer from insanity. I enjoy it...

RE: Getting into micros, need a chip to start

You and me both...

RE: Getting into micros, need a chip to start

They have a CoCo emulator for Mame...  Now where did I put those cassettes my programs are stored on?!?  

RE: Getting into micros, need a chip to start

zeitghost-

I have worked with PIC micros and I find them pretty easy. But I have no experience with the other standard mfgs. Why do call the PIC architecture hideous? Is Atmel or another better?

e2zn

RE: Getting into micros, need a chip to start

No they aren't any better(or worse).  But they are no longer straight forward like a Z80 or a 6802 etc.

Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com

RE: Getting into micros, need a chip to start

I thought the 8080 architecture was actually elegant.  If you list the mnemonics and corresponding binary codes in octal and sort them, you see the bits are organized in a very regular way.

operand | operation | destination   ... like that

Mike Halloran
Pembroke Pines, FL, USA

RE: Getting into micros, need a chip to start

Hiya-

I'm pretty darn sure that Zilog still ships a variant of
it's old Z80 CPUs.

For fun a couple of years ago, I wanted to use the newer
memory chips with a Z80 (I actually wanted a 6502, but I
couldn't find any at the time.  6502's are no longer made,
just some FPGA cores I think).

Anyway, I was between jobs at the time and it was in the
summer.  So I took a hand wrap tool, my little board and
sockets and went off to Carl's Jr. to wire wrap my board
right there at the nice air conditioned bench, sipping
at my free refills iced tea.

Since I work in SillyCone Valley, there were several other
customers that came over and struck up conversations with
me.  Usually older guys who used to wire wrap themselves.
Many of them were quite suprised that one could still even
get Z80s, even more so when they heard that you can still
get the 40 pin DIP versions.

There are some BIG EPROMs and static RAMs available these
days.  Nice.

  Cheers,

   Rich S.

RE: Getting into micros, need a chip to start

An 8085 is an 8080 with two extra instructions and a different bus.  The Z80 used a couple of unused 8080 opcodes as lead-ins to a set of additional instructions that were logical extensions to what an 8080 could do, but the binaries didn't appear real well organized.  

That was at one time important to me because I was trying to make a V30 run Z80 code.  It would have been easy if the V30 had a 'bad opcode' trap.  (A V30 is an 8086 with a couple of extra instructions that turn it into an 8080, and back again.)

That led to an exploration of 8086 opcodes, which appeared to have been assigned pretty much at random.  In that sense, the Pentium descends more from the Z80 than it does from the 8085.

Mike Halloran
Pembroke Pines, FL, USA

RE: Getting into micros, need a chip to start

Agreed.  And I to have used the V30 and V40.  :(

Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com

RE: Getting into micros, need a chip to start

(OP)
I don't know about all that stuff you guys are talking about, but I got these simple Parallax chips in yesterday with a demo board.  I have never written any Basic before, but I am almost 80% done with the programing for my project ---minus any serial communication.  The stamp  I got has 32 i/os.  

I wish I had of gotten into this a long time ago.  Next I will try out the ethernet add on boards.  The chip supposedly has a very quick and easy method for daisy chaining lots of them together, then send serial numbers over a line and wait for a response.  Who knows, maybe do both methods at the same time?  Poll on a single wire and use wireless ethernet for alarmsa nd polling?

btw How much harder is C+ than this Pbasic?  Microchips require a more complicated language right?

RE: Getting into micros, need a chip to start

Hi itsmoked and originator-

Hi itsmoked.  No, it was the Carl's Jr. on Homestead in
Sunnyvale, but I know the Jack in the Box on El Camino!

If I remember my computer lore correctly, the guy that
designed the 8080 "jumped ship" and went over to Zilog to
create the Z80 CPU.  THAT's very fuzzy in my memory so
that could be an urban legend.

Also, again if memory serves me right, the 8085 extra two
instructions were SID and SOD (serial in and serial out).
Not to a uart, but a pair of pins on the chip.  And the
8085 was MUCH different than the 8080 hardware wise.  It
used a multiplexed data/address bus.  In some ways it
was easier than the 8080 designs.

Originator.  Congratulations on the parallax.  I went a
slightly different tack on my microchip stuff.  I believe
that the "stamps" are PIC based with a little basic
interpreter.  I could be wrong and someone please correct
me. However, I looked at the price of the stamps vs. the
cost of a plain pic available from Digikey, Mouser, or
a whole host of mail order catalogs.  Microchip at the
time (and still may) gave away 5 PICs for people to play
with (although it took a LONG time to arrive in the mail).
The standard PIC that I use now is a 16F648A.  They are
under $2.00 each in quantity 25 (the number that I usually
buy at one shot).  I started out with the 16F628 and
home rolled a little programmer for it that uses the
parallel port of the PC to program.  Maybe as mentioned,
the microchip assembler and simulator is free from the
microchip site.

The 16F6XX class of PICs are 18 pins, have an internal
clock so no crystal or resonator to mess with.  In fact,
other than I/O, all you need is a small cap (0.01 uf)
across the supply pins and optionally a 10K pull up for
the reset line (optional, some programmers use RA5 as
an I/O rather than MCLR, mine doesn't).  I use standard
push in proto boards for quickie designs and as a basis
for downloading (programming) the pic's flash memory.
So, with my laptop, a little 5V wall wort, and ICD2
(mentioned later), I can go do a lot of design at a
Starbuck's coffee shop (I've graduated from Carl's, no
power) and have some nice iced tea, have a nice window
to look out of, and people to chat with.  Cheaper than
renting an office for sure.  Add a logic probe and or
a little USB logic analyzer and I can do hardware debug
there too!  Truth to tell, I haven't dragged the logic
analyzer out of the pouch at Starbucks (yet). But it's
there if I need it.  Shoot I even do my PCB layouts there
now with the laptop.  No more sitting in front of a $25K
workstation using Mentor for me!

Anyway, back to the pics.

For about $2.00 the chip then becomes a logic replacement
element and you can just about use them everywhere.  One
wag said:

"Why use a 555 timer when you have a PIC!"

I use the assembler a lot, but I'm a grizzeld old fart when
it comes to programming.  I've done Harvard architecture
programming for just about as long as a Von Neumann
architecture machines (that's why the PIC architecture is
so "bad").

However, after learning to use the assembler in little
projects and gaining confidence with the toolchain, you
might want to go to a C compiler for additional ease in
programming.  I personally use the cc5x free compiler,
although I've heard good things about the free C compiler
from microchip (the other ones mentioned in the list I
don't have experience with).  My choice for the cc5x was
that although they don't have "free" versions that generate
object modules greater than 1K words, they allow one with
a bit of dinking around, to LINK the modules for the full
8K words found in the standard "MAX" 16F series of PICs.

Another very popular PIC is the larger 16F877(A) chips.
These include much more I/O and 8 channels of A/D along
with the aforementioned 8K words of flash program store.
These require a crystal or resonator to operate with.
I typically buy these a couple at a time for about $7.00
each.  Most of the time in 40pin DIP.  All the pics have
various package designs, with surface mount and lead free
available. For prototype work where space is not an issue,
the DIPs work fine for me.  

My final pic that I use is the 12F675.  My "little guy".
No UART on them, but 3(4) channels of A/D decent ram and
for me, an 8 pin DIP configuration.  Again, no crystal
and use the internal oscillator.

So, I have my 3 models and know them all pretty well. A
mini, midi, and maxie pic to choose from.  There are
hundreds of different PICs available.  One can go nuts
trying to learn them all.  I suggest picking a couple and
learning them.  Get to know them well, then if you have
a need for a different one, go to the new one as needed.

I personally "graduated" to an ICD2 debugger/programmer
but you might be just as happy doing the "raw" debug
mode (which you will find out about later).  The ICD2 is
about $150 from Microchip (there are, I'm told, cheaper
knockoffs out there).  I had to do a design for a
customer who wanted to program his pics and fab his own
boards.  No problem.  The design however, worked out best
with 2 pics in it, communicating with each other.  So,
I got two of the ICD2s, one for myself and one for the
customer.  I left one for him to do his programming with.
Saves a BUNCH of time.

There are even more expensive debuggers offered by
microchip, but I tend to only buy the tools that I need.
Again, YMMV.

Finally, there are some very good support groups for the
PICs out there.  Two that come to mind and ones that I
monitor are the yahoo pic list:

http://groups.yahoo.com/group/piclist/

although, of late, it's been much slower than it used to
be.  I read the MIT piclist from gemane reader rather than
having it as a mail group.  This is a group with some
real great contributors and although sometimes off topic,
there is good information to snoop through.  My link and
reader for it is:

http://news.gmane.org/gmane.comp.hardware.microcontrollers.pic

Of course, you can always ask questions here.

We oughta do a FAQ on this subject..... Sigh.  Seems
like I remember writing this a time or two.

Best of luck.  Keep us informed.

  Cheers,

   Rich S.

RE: Getting into micros, need a chip to start

Rich; No 18's?? Once I used one of them it was no turning back!

How much harder is C+ than this Pbasic?

In my opinion a lot harder.  I hate C++! I know of no good C++ compilers for small micros.  C++ is what brought us the Windoz plague of bloatware.
Now C is another story.  If you keep to the simple constructs and pay attention it is not very hard.  Probably the hardest thing about C is setting up the tools.  That can be a bit of a pain.

Microchips require a more complicated language right?
Question does not compute.

Microchip is the name of a company with thousands of different parts.

If you mean Microchip's PIC family of microprocessors then um.. the question still doesn't compute.

Any processor can end up with "firmware" in it many, many, different ways.

Your Stamp has a PIC on it that you are programming using a running program already in it called an interpreter.  You can use compilers or assemblers or Forth or Java to create programs to run in any microprocessor.

Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com

RE: Getting into micros, need a chip to start

(OP)
I meant Microchip PIC's

Hey many thank for super detailed break down.  Since I don't have the time to dive into anything more complicated than basic, BUT,  I still want to hack around with prototypes, here is my conclusion:

Build my own prototype projects using Stamps or Stamp OEM parts for production where I don't care about the difference in a part costing 2 or 20, as long as it works.   My product will already cost me over 2000 each in low quantities, so $20 is not a big concern in this case.  If in the case where I need more whatever  -- speed, power, cost reduction, DSP, a/d,  then what about I send my working Basic instruction set to someone that can adapt it to a 16 or 18 series PIC?  OR, Even build a board to hold either the Stamp or PIC, and interchange or swap out when it as production level with the cheaper PIC?  

Ideally keeping things in a rhelm tat I can modify is the best case though for now.

RE: Getting into micros, need a chip to start

Yes, the Stamp is a PIC with a built-in BASIC interpreter.  Even the oldest versions will do 2000 instructions/ second, so you don't need to be in a big hurry to use a different language.

Me, I'd use _anything_ but C or its offspring.

I can write modular, object oriented, reliable software, usually bug-free on the second attempt, in assembler or FORTH or BASIC.  I'm a little slower in Pascal, because I never remember the right way to hold my tongue, and waste a lot of time fighting with the compiler over syntax.

With C, programming goes fairly fast, but I always manage to run into some archaic bug that 'everybody knows about', except me.  I've tried learning it on several occasions.  My eyes usually glaze over after the 150th page of '... except when...'.

Mike Halloran
Pembroke Pines, FL, USA

RE: Getting into micros, need a chip to start

Mike I know what you mean.  I have the most expensive highest end C compiler for PICs.  I use pretty fundamental commands whenever I can and I still find compiler bugs that require the factory compiler writers to figure out.

originator; You have a good pretty good plan there.  Get it working pretty much the way you want it.  This educates you to the point that you can specify and understand the control aspects.  But when you see production coming I strongly,(most strongly), suggest you pull in an experienced designer to roll you a small, inexpensive, control system that has exactly what you need and is commercially tough.

  There are a really huge number of pitfalls that await the unwary and inexperienced.  These would mean nothing to the hobbyist or the one or two off job but could really hammer you on a production run or worse with a hundred installed units. (The stuff of nightmares.)

Good luck and happy programming.

Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com

RE: Getting into micros, need a chip to start

Murphy's corollary-

"Prototype's always work"

  Cheers,

   Rich S.

RE: Getting into micros, need a chip to start

(OP)
this programming stuff can become addictive i think

RE: Getting into micros, need a chip to start

C is a wonderful language; I spent 10 years coding in FORTRAN without needing to look at the assembler the compiler produced.

I do it quite regularly with C to find out if the compiler is producing code that does what I thought I wanted...

RE: Getting into micros, need a chip to start

(OP)
Hey  I got a question now that I am underway programming the thing to replicated the logic stuff.  When you are programming, to what extreme do you go towards building the ins and outs to demontrate the real project?  

I have maxed out this little built in bread board on the demo kit and am going to make a circuit board with buttons to represent all inputs, and leds or  a real motor controller to send the outputs to test.  What do you guys do?

I suspect that with enough practice you don't need to see the real world?



Side note: serial vs parallel.  If you have a system with 16 or less units you wanted to monitor, and you knew it was not going to go beyond that limit, would you buss 4 sets of wires to all the units off a master, then send out a request to an address, say 0101. and the reply could contain on 2 or 3 very simple one bit responses on seperate lines?

like this maybe:

Master sends out 0001  over 4 wires

Slave has the code built in that says:

REQUEST        VAR     INA    ' inputs  0,1, 2, 3  
STATUS1        VAR     OUT5     'state of something
STATUS2        VAR     OUT6     'state of something else


if REQUEST = %0001 then
output7  =  STATUS1     'a buss wire wire to master
output8  =  STATUS2      'another buss wire to master
pause 50
output7 = 0
output 8 = 0
endif

Master can then do something with that info, like send it over internet, store it with time stamps, send alarm, etc

Just curious really.  Supposedly this stamp does 12,000 lines a second, in that case  it could quesry 16 units in real time and never miss a thing, or space the request out a little if needed.








RE: Getting into micros, need a chip to start

I'm having a hard time following your questions due to your terminology.  What are you calling a unit??

Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com

RE: Getting into micros, need a chip to start

(OP)
Ha! Well  It must be the sleep deprivation?  A "unit" would consist of one complete door system operated by a microcontroller and touch interface.  In the above example of a home or small business concept, 16 or less "units" are connected to one master processor attached to a PC for monitoring, alarm setting, remote control, internet remote access, etc etc.  What I was curious about was in such a small scale application, would 4 wires bussed to all the units make sense over a serial implementation even at a production scale?

I am aware of X10 but was leaning against getting involed with that protocol.  

More to the point, I really just wanted to experiment with making several door units talk to a master, and start thinking about how to implement a PC based proprietary software to monitor and control them on a small scale.  

Sorry for the vagueness

RE: Getting into micros, need a chip to start

The more advanced PICs actually have a master/slave serial setup.  It's a 9-bit protocol, if the 9th bit is set (clear?), the remaining 8-bits will be an address.  If the address matches what the slave is set for, it enables listening to the remaining bytes until you again disable it.  VERY useful little tool, and it's all built in to the hardware, and I love interrupt-driven stuff (polling sucks!)

Dan - Owner
http://www.Hi-TecDesigns.com

RE: Getting into micros, need a chip to start

Yeah, you could do a master/slave polling setup, and multiplex sensors, etc.  It can get complicated pretty quickly.

Or you could put a PIC at each door, programmed with an identity code, and have them just send status report packets at regular or random intervals, all over the same two wires.  The master then just has to listen, and keep a log to detect broken wires or dead PICs.  Collisions on the wire can be detected with checksums in the packets; just discard bad packets.

If you don't need a _continuous_ stream of news from each sensor, there are lots of ways to make inexpensive networks.

Mike Halloran
Pembroke Pines, FL, USA

RE: Getting into micros, need a chip to start

Cheap and to the point with wires would be RS485 multi-drop.

No unit ever volunteers anything.  They only ever respond to a question from the master.

That is what you should start with.  It needs two wires and a ground.  You can use the shield of a single shielded twisted pair cable for the ground.


Google away..
http://www.bb-elec.com/tech_articles/rs422_485_app_note/system_configuration.asp#systems

Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com

RE: Getting into micros, need a chip to start

Hiya-

O.K. this is the "door" thread.  Again, I would vote
for the signals passed on the AC mains. More complex
electronically, but much easier in terms of implementation
without having a second set of control wires.  Just pass
the high freqency signal from the "units" master/slave or
collision type (errr, I'd have to think about that a bit),
yeah it should work, to whatever you use to power the doors,
which I would assume to be derived somewhere locally from
110VAC.  

This way a "door unit" need only be wired to the nearest
duplex box.  No running extra wires.

If this doesn't ring a bell, there was a thread on one
of these sections where someone was interested in doing
a door alarm/web interface for hotels as well as small
businesses.  There was a lot of talk about ethernet
and routers.  You might reference that for additional
information and some thoughts by me and, more importantly,
by others.

 Cheers,

  Rich S.

RE: Getting into micros, need a chip to start

(OP)
The AC convention is interesting, but In the event of power out you are not going to communicate unless AC methods can talk when the AC is down just as well (excepting the case of an AC backup).  My system is battery operated and will run for days on its own, so I'd like to consider a system to run own on its own wires, or wireless, to a Master that is battery backed up as well, so that the entire sytstem can be monitored and controlled via internet even in no power.  BTW the hotel threads are most likely mine, I like to spread the agitation around as much as possible.  

Right now I am looking for a way to network several sizes of systems together, under 10 is the immediate need.  The ethernet idea Keith has discussed is my favorite so far:  it's wireless and  can be battery operated for power out states, and can deal with polling and interrupts easily.

I am really glad to have gotten all the great ideas on methods to do this.  We are a small company trying to launch something "hi-techy" on a shoe string.  The product is never to be intended as the sole fire and alarm system, but rather an add-on benefit for the gadget minded, not to mention a pretty slick backup plan for the rare cases of fires of alarms.  In reality, people are scared of motorized doors in homes, so I have to be way over the top redundant with safety measures to overcome those fears of being "trapped", etc.   

The small home installs are right around the corner.  I am looking to nail down the final plan for the networking of a small number of units and get going on that design, which will also require a PC based app, or at least an html/ flash/ or java based remote control, monitoring and logging implementation.

The ideal sitution is to use the stamp based control that I am almost done programming, and add on the parts needed for communication, leaving that to someone else.  The control is very simple, and the stamp can talk to another processor that is stuck on the board in the cases where networking is required.

You guys have been great, I appreciated it.

 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources