MikeR
|
| posted on 24/1/06 at 12:23 AM |
|
|
programming PIC / STAMP / little processors
Folks, looking at writing something simple on a little eeprom type devide.
minimum i want to do is measure the fuel level but what i'd really like to do is measure fuel, oil temp, oil pressure, water temp and output
either via LED or high contrast / definition / visible easily in day light LCD.
I'm a C programmer by trade so would like to stick to that. Any suggestions as to what i should be looking at ?
|
|
|
|
|
NS Dev
|
| posted on 24/1/06 at 12:35 AM |
|
|
Ah Mike! Didn't know (for some strange reason!) that you were a C expert!!
Will no doubt be ringing you asap re. Chris's big project. He needs to learn lots of C very quickly so you might be very helpful!! (payment in
beer........sorry Cider!!!!)
Retro RWD is the way forward...........automotive fabrication, car restoration, sheetmetal work, engine conversion
retro car restoration and tuning
|
|
|
locogeoff
|
| posted on 24/1/06 at 01:11 AM |
|
|
Personally I like Microchips PICs but have recently heard about an ATMEL device that may be exactly what you want
i.e. a number of A/D converters (may be multiplexed) on a sweety money device, will get the device number for you.
know sod all about LCD drivers but I'm sure there is a datasheet on microchips website that will tell you exactly how to acheive this
C is availablke for both, gcc on the ATMEL I believe and for the amount of code you'd be writting the C demo from microchip would be sufficient
(probably)
What do you code? Embedded EFT mself though stuff is so complex these days it may as well be on a mainframe.
[Edited on 24/1/06 by locogeoff]
|
|
|
MikeR
|
| posted on 24/1/06 at 08:55 AM |
|
|
ok, admission time, i haven't cut code in about 5 or 6 years. In management now but i can still remember how to do it (i hope) and i've
got plenty of reference material around me (ie all the old code i wrote).
work in developing shop systems for chemists.
|
|
|
jambojeef
|
| posted on 24/1/06 at 09:13 AM |
|
|
Hi there,
Yeah - Im looking at using something similar as a boost controller.
Try here - www.tech-supplies.co.uk
They're primarily for education but you can get yourself set up with the software, lead and project board for very little.
They are ideal for playing around with but can be a little troublesome sometimes, like the programs not running consistently in m y experience.
Im trying to find a way of running fail-safes through it if Im relying on it to limit boost levels but you'd be pretty safe with a fuel gauge I
would guess?
Geoff
|
|
|
phaeton
|
| posted on 24/1/06 at 09:23 AM |
|
|
Hello Mike,
We are using Atmel 8 bit microcontrollers.
You can build them up with very little external components and they are quite simple to program.
1 atmel is used to drive the relays for all the electrics in the car. We have used a micro controller and relays because i wanted to use momentarily
switches, and is quite flexible (like for the windshield wipers: press once for interval twice for continuously operation, and for the lights in
combination with a LDR).
I am using it for 2 years now and it has never broke down in opposite to other components in the car :-( .
We are now constructing a microcontroller driven led tacho. It is driving 12 tri-color leds for rev's, and we are combining this with lambda
sensors for every cylinder with a selection button and god knows what more while installing it.
To drive relay/ led or other power consuming devices, you have to use a Darlington array (ULN ic’s). For the analogue inputs (like temperature and
fuel level) you have to use the A/D converter channel. We have found that you can best use one channel per analogue signal. You can multiplex them but
it’s not worth the hassle with a analogue signal. It’s hard enough to get the fuzzy analogue signal converted to a nice digital reading. Here for you
will need a lot of samples. The easiest is to buy a bigger Atmel with more a/d converters.
The output you can easily multiplex by using shift registers.
The nice thing of the atmel’s is that that can talk to each other very easly by the SPI serial interface.
A nice thing to do is to use an Atmel (e.g. ATmega169) with a build in LCD driver. But due to the package they come in, are these quite hard to
solder.
[Edited on 24/1/06 by phaeton]
|
|
|
steve_gus
|
| posted on 24/1/06 at 10:36 AM |
|
|
there are various free C compilers to work with microchip PIC processors that can be found on google.
I am not familiar with the Atmel devices, but the microchip PIC series are well used by hobbyists and you may find it easier to get support, ideas,
free develoment support stuf, and cheap programmers and the like.
there is a HUGE range of PIC devices, with a lot of analog - and serial interfaces, not just spi
atb
steve
[Edited on 24/1/06 by steve_gus]
http://www.locostbuilder.co.uk
Just knock off the 's'!
|
|
|
Bob C
|
| posted on 24/1/06 at 11:12 AM |
|
|
Actually the atmel AVR devices outperform the equivalent PIC (having been developed with the benefit of hindsight re the PICs) and are supplied with a
better packaged 'C' system (it's quite a learning curve to get GNU 'C' to do anything).
On the smallest devices 'C' is probably inappropriate & you should use assembler.
They'll all keep you out of trouble for a while in the evenings......
cheers
Bob
|
|
|
locogeoff
|
| posted on 24/1/06 at 11:28 AM |
|
|
The devices I heard of recently was the Atmel ATmega range
ATmega162 - ATmega16 . . .
A collegue of mine is using these currently and is well impressed with the performance
|
|
|
02GF74
|
| posted on 24/1/06 at 12:59 PM |
|
|
take a peek at maplins website. they do development board for about £30 but you need to solder it yourself. I am waiting until it comes on special
offer; last time I was a bit slow.
there are a number of PIC you can use;
PIC12F675 has four 10-bit A/D, for £1.49.
Driving LCD display can be done in one of 2 ways. There is an LCD driver chip that simplifies it or else you need to drive the individual segments
(depends on you LCD if dot matrix then you need driver chip). The PIC12F675 has only 8 pins so there will be some multiplexing; I dare say there a
more expsnive versions with more pins that are less effort to wire.
|
|
|
MikeR
|
| posted on 24/1/06 at 05:51 PM |
|
|
This is leading onto my next question ....... there are a lot of chips ....... how the heck do you decide what you want without spending a month
reading every spec sheet?
I want to read in 4 analogue signals, ( perhaps a couple of digital ones (speedo / tacho) if i get really adventurous) and display them. Originally
via a series of LEDS as i was worried about how visible a LCD would be in a car.
|
|
|
phaeton
|
| posted on 24/1/06 at 08:39 PM |
|
|
There will be a lot of reading when you start using microcontrollers. Pick a brand that suit your needs and where you can ask someone to help when you
are stuck (eg forums/ acquaintance).
I like the atmel's because they are simple to use and have a very good performance. First you have to decide how much analogue signals you have
to work with, and how much processing power you will need to do something with it. A signal from your fuel level sender will be very very very very
fluctuating. So this means a lot of samples and processing. A temperature sender will be less demanding because it isn't fluctuating so much.
But when you are finnaly there and understand the basic and principles of the microcontroller and programming you can do some very nice stuff.
But for the first project you maybe want to keep it simple.
|
|
|
MikeR
|
| posted on 24/1/06 at 08:44 PM |
|
|
simple - ha, don't know the meaning of the word
(joking)
interesting that you need lots of samples for the fuel sender, hadn't thought of that but its obvious why when you say it.
the first thing will be just a fuel level gauge.
Suppose i'm just looking for reconmendations from people.
4 a/ds (or more in case i get really bored at night) plus some pulse counters is all i can think i need for inputs at the moment.
After that some way of displaying the data, as i said before i'm not convinced you can see a LCD easily enough in a car hence LEDS. I suppose
some flashing big LEDS for "OI, MUPPET LOOK AT THIS THE ENGINE IS ABOUT TO BLOW" would be good as well.
|
|
|
MikeRJ
|
| posted on 24/1/06 at 11:35 PM |
|
|
The best C compiler for PIC's bar none, is the HiTech compiler. This is a professional compiler, with a professional price tag, but they do
offer a free version called "PICC Lite" that is limited in the devices it supports and the amount of code it will compile but should be
more than adequate for this project.
http://www.htsoft.com
The big advantage that PICs have over pretty much everything else is the support available on the internet, (either via web pages, forums or mailing
lists) and the vast number of very simply programmers an software available. The AVR also has a growing following, especialy with the free GCC
compiler (which is more suitable for the larger devices IMO as I wasn't overly impressed with it's optimisation).
The fuel sender does not need a high sample rate if you simply use a low pass filter on the sensor input. This is advisable for all sensor inputs in
any case to reduce errors caused by noise. Once you have reduced the bandwidth sufficiently, you can do any further filtering in software with a
relatively low sample rate (of at least twice the bandwidth of the hardware filter), giving low CPU overhead without aliasing problems.
Driving lots of LED's is usualy acomplished by a process called multiplexing, in order to reduce the pin count of the micro and the amount of
external circuitry. In the case of your gauges, you would simply illuminate one set of LED's at a time e.g. first the fuel, then temperature
then oil etc. By repeating this quickly enough, all the guages appear to be illuminated at the same time. The downside is that because each guage is
only illumintaed for a 1/4 of the time, they are less bright. You compensate for this by increasing the peak current thorugh the LEDs (bearing in
mind the devices limits).
This scheme also gives you the opportunity of varying the brightness (for e.g. night mode) with no further hardware, simply by adjusting the
"on" time of the LED's.
|
|
|
phaeton
|
| posted on 26/1/06 at 09:19 AM |
|
|
I'm doing now a 12 segment tri color led bar. All these can be switched individualy and show one of the three colors. I will switch (with a
shift register) the common cathode (or was is anode I always use the wrong one) to the ground with a darlington array. I have two switchable outputs
(12v). So i can get every color state of the leds individualy with the timing in the software.
This becomes a tacho and a (wideband?) quad lambda meter. I can switch between these with a selection button.
This maybe a little bit overdone but i got 4 lambdasensor frommy local scrappy for peanuts. This way i can tweak every carb to preform best. 
|
|
|
stevebubs
|
| posted on 26/1/06 at 11:19 AM |
|
|
Good book
Did some embedded C a few years ago...excellent book at the time was titled "C for engineers" or similar.
Had loads of practical examples that would be suitable for the above projects.
Stephen
|
|
|
tks
|
| posted on 28/1/06 at 07:16 PM |
|
|
mhh
i personally use pics
and use an basic compiler for it.
I think that you don't want to spend the time programming the chips in C nor in assembler..
but offourse there are C compilers
to do the job for you.
I would recommend an 16F877a.
Also i recommend you to download a bootloader.
a bootloader is a small program wich i sin the chip, using that program you reprogram serially every time the chip (@56000Bps) sow a change in code is
simply applied to the project.
for this chip model there are also programmers everywhere...
sow your starting costs are also low.
Also you should take a look if free sample are there in your situation.
Tks
p.s. the 16F877a (14bits) in 40pins model: has 8ADC's and a UART port (com port) and the rest are all digital pins.
sow very versatile, it works @ 20Mhz.
and has a smaller instruction set as the atmels.
Thats also the reason that the atmels are faster. but offcourse there are more difficult to program.
if you want real Ateml beating power you could use the 18Fxxx series these are 40Mhz.. and 16Bits devices
if you want an simple model pick the 16F819/818 they have builtin OSCILIATOR
and work at 4Mhz (if internal is used).
they also have ADC and are only 20pins ore something..
[Edited on 28/1/06 by tks]
The above comments are always meant to be from the above persons perspective.
|
|
|
ceebmoj
|
| posted on 28/1/06 at 08:17 PM |
|
|
hi all,
Im an embeded c develeper I would also recomend the hi tec compiner.
I have the flolowing for sale on ebay at the moment if you are thinking of developing some stuff it will be helpful
http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=5857911273&rd=1&sspagename=STRK%3AMESE%3AIT&rd=1
|
|
|
blueshift
|
| posted on 29/1/06 at 02:02 PM |
|
|
I'm playing with PICs at the moment, 18F series specifically..
I don't know if they still do this, but a couple of years ago at least, Microchip would send out free samples, 3 or so of a few different kinds
of PIC (you could choose which ones) for "evaluation". That would be all you need, they are reprogrammable.
The I/SP models support in-circuit serial programming, you can reprogram them whenever you like after you've built them into a circuit.. and
they don't need separate bootloader code. Those are what I use.
|
|
|
ceebmoj
|
| posted on 29/1/06 at 07:46 PM |
|
|
yep microtec still give out free samples you can orders up to 15 at a time and 3 of any one type (per mouth) so you can order difrent package option
of the same devise to get a good range of samples.
blake
|
|
|
tks
|
| posted on 29/1/06 at 07:48 PM |
|
|
i have my rooms full of them...
i wanted to point it out in a more politcal way
The above comments are always meant to be from the above persons perspective.
|
|
|
MikeRJ
|
| posted on 30/1/06 at 08:31 AM |
|
|
quote: Originally posted by ceebmoj
yep microtec still give out free samples you can orders up to 15 at a time and 3 of any one type (per mouth) so you can order difrent package option
of the same devise to get a good range of samples.
blake
They have considerably cut back on samples now due to people taking the wee and just ordering loads to sell on Ebay. They will not supply sample to
all countries either.
|
|
|