Jump to content
  • Welcome to 205GTIDrivers.com!

    Hello dear visitor! Feel free to browse but we invite you to register completely free of charge in order to enjoy the full functionality of the website.

Sign in to follow this  
brumster

[Misc_Work] Sequential Gearstick & Gear Indicator

Recommended Posts

brumster

Alex's thread discussion has got me thinking whether this may interest people if I stick it on here. It's a bit of a long-term project of mine while I save up for a sequential gearbox, but a large part of the cost of the final kit would be taken up by the gearlever and the gear position indicator - Sadev prices certainly are rather ridiculous, well over a grand for both when I can quite easily make them a hell of a load cheaper.

 

Here's the sort of things....

 

CTM60x40.jpgIMG_0117.JPG

 

I've got a friend who has a 5-axis CNC machine who is happy to do the stick, and I might even do the indicator box in aluminium eventually (he wants some bits for his guys to practice setting up for). The gear position indicator does not need to be anything fancy - a single digit as above, and I would want it to automatically adjust brightness depending upon daytime or nightime operation (bright in the day; dimmer of an evening). All configurable and microprocessor controlled, so I'll write the code myself - pretty basic stuff at this level to be honest (I've actually already breadboarded a basic version a long time ago when I first got into Microcontrollers - video

. So it will just be formalising this a little.

 

I'll show use of CADSoft Eagle to design the electronic circuit and the board, Delcam PowerShape for the 3D modelling, and if it's economically viable I might even get the PCB's properly fabricated (problem here is economies of scale - I'd probably need to make a good 5 or 10 of them and sell the remainder to make it worth my while, so I might just protoboard or etch a single board if need be).

 

Might be a slow project this one... I'm in no rush, as the gearbox costs a fortune it's unlikely I'll be getting it this year, but if I can get these bits out of the way it'll save me a good portion of the cost!

Share this post


Link to post
Share on other sites
brumster

High-level requirements & component choice

 

Main thing is that the display has to be nice and visible and bright. I surfed through the optoelectronics section of Farnell (uk.farnell.com) and picked out the Kingbright SA23-12SRWA single-digit 7 segment display. It's big (2.3 inch), red, and uses several LED's within each segment to make for quite a bright display if need be. Each segment pulls 20mA (milliamps) at just over 7v, with a maximum of 10v before you start popping the light emitting diodes within it, so we need to be mindful of the voltage we pump through it. But, on the whole, it'll do. It's a common anode design, which means a single +ve is fed into the segment module, and you switch the earths on each segment to turn on the ones you want. LEDs are diodes, remember, so if you feed them the wrong way round they simply won't light. The anode takes a positive; the negative is called the cathode.

 

Datasheet

 

So what do we want the display to do? We need to plan out what inputs and outputs we need so that we can choose a suitable microcontroller with the necessary features. My microcontroller (hereafter MCU) of choice is Atmel, just because that's what I picked all those years ago and have just become familiar with them, but another common make is PIC. Atmel do several models of their 8-bit MCU range, so I need to plan out what we need and choose an appropriate model.

 

Inputs/Outputs

1 x analogue for a light dependent resistor (LDR). This will sit inside the casing but will be exposed to ambient light, and will allow the MCU to sense the current lighting around the box (day or night) and adjust the brightness of the display accordingly. Therefore I need a pin on the MCU that is assigned to an Analogue to Digital Converter (ADC) - this can measure a varying voltage and convert it to digital representation within the MCU. I can then test the value in software, and adjust brightness accordingly.

 

1x analogue for gear position sensor. The is the main sensor on the gearbox, effectively just a variable resistor that will tell us what gear the gearbox is in. So another ADC pin needed on the MCU.

 

8x digital outputs to control the 7-segment display (7 segments to represent the number, and an 8th is used to drive a 'decimal point' in the bottom corner, which I think I might end up using as some sort of indicator). Each output will be turned on or off accordingly, and will indirectly drive the display via a thing called a Darlington array (more of that later). The MCU output pins can drive low-current loads but the peak current on this LED display is ~155mA according to the spec sheet, and there's no chance of the MCU providing enough current for these directly.

 

Now some people will be thinking "why not use a 7 segment driver?", another integrated circuit (IC) chip that handles the driving of the display for you. This is a valid point but I'm trying to keep realestate free on the board - I need it to be compact, and keep costs down. It's a possibility, but at this point I'm not sure it's really warranted because the AVR chip can handle my requirements fine as it is. All will become apparent.

 

1x digital input - a simple on/off momentary button that will be present on the casing, for putting the unit into configuration mode. A little microswitch, basically.

 

1x PWM output (possibly). At this point I am unsure how we'll drive the brightness of the display. There are two options. 1 is to have 2 settings - low and bright - and supply the extra voltage for the bright mode using a transistor driven by a simple single output pin. But a more efficient and configurable approach would be to use an approach called PWM generation in the MCU, to vary the brightness of the display to one of any values in software. This is quite a common technique with motor control, for example, where you pulse the voltage very very quickly into a component - and by varying the delay between on and off you can control the speed of the motor or, in our case, the brightness of the LED. You've probably seen the effects of this on TV quite often - LED brakes lights that appear to be flickering on and off on video? I'll cover this in detail when we get to it.

 

So I know I need 8 digital output pins, 1 digital input pin, 2 ADC inputs and 1 PWM-generated output. So I look down Atmel's part list and pick the smallest, cheapest MCU that ticks the boxes which is... the ATTiny26....

 

attiny26-16pi.jpg

Bless it, the little thing. All 16 pins of it. 8MHz of processing power, 2KB of flash memory, 11x ADC inputs, 2x PWM outputs, and even support for SPI (not that I need it).

 

Finally we need a 5v power supply to that IC - pumping 14v of car voltage into it will "let the magic smoke out". There are a couple of approaches I've used for 5v power supplies.

 

One is using a TO220 form-factor 78xx linear voltage regulator. TO220 is the package type (the shape and format of the part), and you've probably seen these umpteen times if you've ever looked inside an electronic component. They're not small compared to other options but they are very simple to implement, but the main downside is they generate heat which needs to be disipated using a heatsink.

 

The other option is to use something like the MC33063A converter. This gives you a configurable voltage all packaged within a nice, discreet 8-pin IC. It saves on heat sink issues but it does need more board space as you need additional components (resistors and capacitors) in order to configure it appropriately.

 

What I will most likely do is, for the early prototyping, go with the 7805 - it's quick and easy to breadboard and get up and running - but when we start designing the final board, if we've got space go to the buck-boost MC33063 (or similar) IC to make it a bit more production-ready... obviously tested beforehand just to make sure. There are slight differences with how the two generate voltage - the 33063A effectively ends up giving you a 'ripple' on the output if you don't configure it appropriately, and that ripple can have bad effects with things like microcontrollers if it's not kept in check. But since we're not doing anything overly-sensitive in this design, it should be fine. Crack open your in-car USB phone charger and you'll more than likely find one of these babies creating the 500mA of 5v you need ;)

 

Ok, enough for one night... more tomorrow hopefully :)

Share this post


Link to post
Share on other sites
sport1901966

I'll be very interested to follow your progress on this. I bought a PICkit2 a while ago and started self-teaching myself the programming in assembly but down to free time haven't been back to it in a while. Will you be including the code you plan to use, I'd be very interested from an educational point of view, however I'd understand if you wanted to keep it proprietary. If the write up so far is something to go on it should be fascinating project!

Share this post


Link to post
Share on other sites
brumster

No, I'll share the code, this is nothing groundbreaking. I'd like to make it fully open and instructional, to a degree. Like you, I got into this a few years back starting from complete scratch, with nothing more than GCSE physics, a good grounding in IT and Wikipedia to help me. As I'm sure you're aware, if you've got the basics of electronics in hand, it's not all that hard in the grand scheme of things. I'd like to share what I've learnt (and maybe learn something along the way, particularly with regard to the 3D design and CNC aspects), maybe inspire others to have a crack at something themselves ;)

Share this post


Link to post
Share on other sites
sport1901966

Sounds good! I didn't get that far unfortunately, just need to find a good project to use as a base for learning and get stuck in. What sort of things have you built so far with MCs?

Share this post


Link to post
Share on other sites
brumster

I've breadboarded some play-arounds with 2-row character LCDs and CAN interfaces, that read an automotive CAN bus. I'm also in the middle of a quite lengthy CAN/USB related control unit which I can't really divulge anything on because it's for a friend with a commercial interest - it's much more in-depth and complex (and slow!). I also did a little project with the little'un last October to make a scary figure for halloween that detected movement at the front door via a PIR and started this Saw figure to glow, shake and generally scare the s*it out of kids :D

  • Like 1

Share this post


Link to post
Share on other sites
brumster

First thing to look at is power requirements, just to make sure we're in the ballpark with whatever power supply we choose. Consulting the data sheets is necessary.

The AVR MCU has an absolute maximum of 200mA but under most situations is unlikely to draw that. Each IO output pin can source 40mA maximum but, again, up to the maximum 200mA on the overall Vcc/GND pins on the MCU. While 40mA would be enough to drive a single segment on our LED display, if we were to display the number "6" (for example) we need to light up 6 actual segment at the same time - a good 20 to 30mA continuous each - and 180mA is not going to float with the MCU. The good news is this means we will not be using the MCU to switch the LEDs directly, but we will use transistors (the electronics equivalent of a relay, if we're thinking automotive terms). Transistors require a lot less current to 'trigger'. It will also allow us to use the 5v MCU outputs to switch a higher voltage.

So, according to the spec sheet, the ATTiny26 MCU will draw about 8 to 15mA at 8MHz and 5V (it's highest speed). We need a 5v power supply capable of meeting this need. It will need to 'step down' the 12-15v from the car supply down to 5v. This is pretty commonplace stuff so no cause for concern.

The 7-segment display is the next big consumer. We know at worst if we lit up every segment we'd need typically 30mA per segment, plus the decimal point LED - that's 8x30mA = 240mA. But the main problem here is the voltage drop. Each segment is made up of *4* diode elements, and each diode requires 1.8v to actually make it light - any less potential difference and it'll do bugger all. So we need to put around 7.4v across each segment in order to light it - so clearly our 5v supply isn't going to do this.

So for these I'm going to use the car supply chopped down to around 8v (certainly no more than 10 maximum, according to the data sheet) with a resistor. I'm then going to use the aford-mentioned PCM approach to "flick" a transistor controlling this 8v on and off very, very quickly. This will pulse the LEDs to light them, and by varying the degree of pulse, I can control the brightness of them. This can all be done in software. A 2N3904 NPN will probably suffice - more of this when we get to it. It can switch 100mA, but we'll only ever be asking it to light one segment at a time, so this is no problem.

Now, we could fit 8 of these things into our board - one for each segment - but that's going to take up some space and look a bit messy. There are IC's that package up an array of transistors into one neat packaged IC. I've got kicking about a ULN2803A Darlington array - a Darlington transistor being a collection of 2 transistors in order to switch a high current from a very low one. Now, in the grand scheme of things, we don't actually need to use a Darlington array - it's switching capability is way more than we really need, but it's just something I have kicking about.

There's also another way it ended up like this - some people might be thinking "why not use a 4511 BCD decoder"? This is a chip that will drive your 7 segment display from a 4-bit (binary coded decimal) input, and it includes all the necessary transistors to switch the 7-segment current. Problem is it only drives the display with numerics 0-9 and I kinda want to be able to light up an "r" for reverse, and a dash "-" for neutral, which a 7-segment driver doesn't let you do. The 4511 also only drives common-cathode 7-segment displays, and my common-anode display is a couple of quid cheaper.

It's not like we're pushed for saving the pins on the MCU anyway.

So, what are we going to need on our workbench for now? Well, let's breadboard it up first and test it out before we delve into making anything irreversible. So, to start with....

 

IMG_20130210_130121%2520%25281024x768%25

Some breadboards to hold our components while we're testing them out - you can see the display in the middle, and the Atmel microcontroller on there too. The little black box at the top with the ribbon cables is a USBtinyISP programmer. This is an essential bit of kit as it's what connects our computer to the microcontroller to program it with code - it's got a USB connector on one side, and the ribbon cables run to what are called standard "ISP" connectors, used to connect to a set of pins on the MCU to program it. On the right we have a simple bench power supply - it can give a nice 1.2A into 9,12,15 or 18 volts. We will use it at 15v to simulate the car power supply.

 

IMG_20130210_130216%2520%25281024x768%25

We'll also need a multimeter - preferably a decent one, £50+, anything less is probably not calibrated great.

 

IMG_20130210_130258%2520%25281024x768%25

Although not needed for the development of this little project, I'm going to be using an Oscilloscope to show you the PCM aspect when we get to it. This Picoscope is quite nice as it uses a PC to provide the display - it's a USB device which operates as a dual-channel oscilloscope and also a wave generator, and the software on your PC covers all the usual features (and other very useful ones). Saves money, as proper bench oscilloscopes are quite expensive. This is a 2204, budget end really, with 10MHz of bandwidth and capable of taking 100 million samples per second. It's a good entry level but it won't set the world on fire, but for most MCU work I don't push bus speeds beyond 10MHz anyway.

 

I'll try and get a circuit schematic done tomorrow to show what's planned.

Share this post


Link to post
Share on other sites
sport1901966

I have one of those picoscopes they are great bits of kit, used it for many things including diagnosing a duff alternator regulator and identifying the missing tooth synchronisation on the Mi16.

 

I've not done anything with the PIC controllers yet. But I built a basic 'electronic dice' using a 555 timer chip and decade counter that would count at very high frequency until the push switch was released, after which it would gradually slow down until stopping. After that I bought the PICkit but haven't got round to really getting into it.

Share this post


Link to post
Share on other sites
brumster

They're good, aren't they!? You're right, they've got lots of automotives features on them, very good for diagnostics, which was another contributing factor when I was looking at purchasing one. I do something wish I had the ease of a bench 'scope (will keep me eye open on ebay for a cheap deal I think, nothing fancy, just something very basic) but all in all the Picoscope is great value and very powerful for the money. The software is good too.

Share this post


Link to post
Share on other sites
brumster

Ok, here's a first cut at a schematic. There are a few bits undecided at the moment, but I'll go into detail below. There's an assumption that you're happy reading an electronic circuit and know what all the symbols mean. Truth is, if you don't, there are a million and one introductions out there on t'interweb that Google will lead you to, if you desire. So, on the assumption you know what's what, here it is (click for detail)...

 

schematic_v01.png

The 5v power supply will need to be tested in the car on some breadboard to check how it stands up to interference and any spikes at turn-off and so forth. Interference plays havoc with MCU's. Would be happy to receive some guidance from anyone in the know here ;).

Here's my reasoning...

Firstly, on the left hand side, the lower (12v) supply is nothing special as it's just to provide a roughly-in-the-ballpark 12v to the 7 segment display; noise on that supply won't be an issue as it's only LEDs suffering.

The 5v supply uses a 78L05 at the moment - it's good for 100mA which is a bit borderline on the MCU but I'm going to try it out and see how we get on (they're only pennies). I want to try and keep away from the larger 7805 if I can help it, to keep space and heat down. I can probably pull the power LED out of the circuit (LED2) to minimise current draw on the final solution. R3 is just a current-limiting resistor in series, 22ohms, mainly to act like a 'choke' and filter out any spikes. There's a Zener diode, D1, to catch anything above 20v and let it through to earth, hopefully keeping it away from the regulator.

To the rest of the schematic, we have...

The Tiny26P, naturally. I've left off any smoothing caps on it's power supply but testing may lead to those getting added as needed.

The 'SET' button you can see is on pin 9 (Port B 6 in AVR speak). In normal operating this will hold pin 8 high but when pressed will drop it to 0v (GND). This is an interrupt pin which means I can set it to detect this button press and fork to a routine in code without having to check the pin constantly, which is a nice little bonus.

JP1 is the ISP header - how we program the chip. It's there for reference but does not necessarily have to be in the final product, if you program the chips off the board and then plug them in, so space considerations can be exlcuded for that.

Then we have the ULN2803A array, 8 transistors in a single DIP package, nice and convenient. All wired up to port A (pins 11 to 20) on the AVR.

The Kingbright SA23-12 7-segment display is on the far right.

There's a 2N3904 transistor down at the bottom that acts as a switch on the common sink for the 7-segment display, and this is going to be triggered by port B3 (pin 4), I'm hoping this can be used to drive some degree of adjustable brightness. If I end up using the PWM generator in the chip then it's important that I wire this up to pin 4 (OC1B) as that's the pin the PWM generator is assigned to - but I can always use it as a general output (on/off) if that aspect doesn't work. I'm not entirely sure if rapidly switching the common earth to the darlington array is a great idea (depends how quickly the transistors in that array and respond to on/off requests with their GND being pulled from beneath their feet several
thousand times a second!). I could work this out by reading the spec sheet for the array, but sometimes it's easier to just suck it and see.

We've got the photo resistor on there in the top corner (PH1), assigned to pin 7 (ADC7 - ADC input).
The gear position sensor will come in on an external connector and feed to pin 8 (ADC8 - another ADC input).

It's tempting to start designing the board at this stage but this is completely pointless, as until you've proven the design you're just wasting your time - the design will inevitably fail in certain areas and need re-designing. Hence why we breadboard first - prove the theory, get it working, then spend time making it pretty :)

I'll make a start on getting this up on breadboard tonight and see if I can report back something interesting.

Share this post


Link to post
Share on other sites
Liquid_106

My head - This

 

I can feel myself understanding this less and less as I read down the page :(

 

Great thread - fantastic that you're bothering to make something rather than buying off a shelf - built not bought B)

Share this post


Link to post
Share on other sites
pip470

Your not alone, I like reading it but I don't have a scooby doo.

Share this post


Link to post
Share on other sites
brumster

That's fair comment, and I don't want it to be that, so I'll endeavour to explain a little more and maybe post some links to material/sites that have helped me in the past. GCSE Physics I'll have to refer you to the government, though ;)

 

Some basic electronics stuff.

Links :-

SparkFun (excellent site - in particular, start with this tutorial)

The Electronics Club

Hobby Projects

Dave Jones often provides some useful videos on EEVblog on YouTube or http://www.eevblog.com/. Good purchasing advice on components, and howto's for certain things like power regulators, when you get that deep ;)

 

Some sources for components :-

Bitsbox - for the regular components (resistors, capacitors, diodes, ICs, breadboard, regulators and so forth) - they're pricing is much better than the biggies like Farnell but when you're after quite specific, select components their range isn't so great. But for starting out you can get nice starter kits from them for very little.

Quasar - a fall back supplier

Farnell - not cheap but when you get to some of the more select components, surface mount stuff and expensive LCD/OLED screens, they have a massive selection and their service is good.

 

And for AVR stuff, the best forums out there....

www.avrfreaks.net

 

If you want to dabble but want the easy path, then a development kit is the way for you. This way you buy a board with all the bits on it already so you can dive straight into the programming; someone else has taken care of all the hassle around power supplies, expensive board design and printing, etc.

Arduino is probably the most reknowned one. You can Youtube thousands of projects people have done with these things :)

My preference is MikroElectronica - their boards are quite comprehensive and ticked a lot of the features I wanted to dabble with (LCDs, CAN interface) - and they have add-on boards to cover most stuff.

 

I've breadboarded the design now. Will put something up later when my broadband bandwidth is out of it's limit period :D.

 

Would a video on YouTube make it easier do you think?

Edited by brumster

Share this post


Link to post
Share on other sites
brumster

Let's change the scene a little to keep some interest up and hopefully show another aspect of the work I'm doing - the design of the enclosure for the module. Now, I could just put this in a general plastic box and that would be perfectly functional (in fact, I probably *will* just put the display into the binnacle of my dashboard near the rev counter), but a friend has a Mazak 5-axis CNC machine he wants to train some staff on, so I'm happy to donate a model or two for their learning exercise :)

 

I'm using Delcam as that's what they have/use to do their modelling. Not used it before but it's actually quite straightforward to get into if you're generally IT-savvy and have a *spot* of nuance about you when it comes to 3D modelling (and I really do mean a spot!).

 

First up was to create the basic box in the correct dimensions to hold the display and the board inside, and round off the edges, thus...

3.jpg

From here I defined a plane surface (in red) to slice through the block effectively creating two halves of the block...

4.jpg

An appropriate-sized cavity was created inside it - this is done by defining a wireframe shape of the cutout you want to make, extruding it out along the Y-axis into a 3D block, and then positioning that block inside the main part and then telling the software to remove the material where the two co-incide...

5.jpg

Repeat for the other piece and we're left with two sides of the enclosure with a chunk of material missing out of the middle....

6.jpg

Then we need to machine in the screw holes and threaded drillings that will clamp the enclosure together - one in each corner. Delcam has a simple function that lets you do this quickly and easily to whatever tolerances you desire, and handles all the countersinking/chamfering of the material where it's needed.

7.jpg

Next job is to cut out the front face to allow the display to be visible, and then some drillings for the wiring, the light sensor and the reset button - but these will need the board schematic to be completed to position them correctly, so there's no point doing those yet. We mights also machine in some standoffs or slots to hold the board, depending upon how much clearance of components we have.

Edited by brumster

Share this post


Link to post
Share on other sites
brumster

Ok, let's throw a bit of code up here then :)

 

This is just a quick bit of code to sanity-check the wiring of the breadboard - all it does it turn on port B3 (which turns on the transistor powering the 7-segment display) and then step through each of the 8 output pins one at a time on the microcontroller, turning them individually on and off. This means I can check that all the segments light up and the wiring is generally sound on the output side. This makes sense to do because you might find you'd wired something up wrong, and you end up chasing what you think are code problems when in fact it's your wiring.

 

/*
 * gearindicator2.c
 *
 * Created: 12/02/2013 16:32:51
 *  Author: Dan Howell
 *
 * AVR Configuration details :
 * ATtiny26
 * PA0-7 : Output pins to drive darlington array, driving 7 segment display (8 active elements including decimal point)
 *         0=segment A, 1=B, 2=C, 3=D, 4=E, 5=F, 6=G, 7=DP (decimal point)
 * PB0-2 : unused (ISP)
 * PB3   : Output, OC1B - control for dim transistor using PWM
 * PB4   : Input, ADC7 - LDR for ambient light sense, 5v
 * PB5   : Input, ADC8 - gearbox position sensor, 5v
 * PB6   : Input, PB6 digital - configuration switch, momentary operation, normally held high. Press drops low.
 * PB7   : Not used (RESET)
 */ 

#include <avr/io.h>
#include <util/delay.h>

#include "main.h"
#include "common.h"

int main(void)
{
	// Configure ports
	// - Disable pull-up resistors
	PORTA=0x00000000;
	PORTB=0x00000000;
	// - Set data direction registers (1 for output pins) - remember RH digit is the least significant bit, is port 0 ;]
	DDRA=0x11111111;
	DDRB=0x00001000;
	
	
    while(1)
    {
        // Turn on port B3 for testing
		sbi(PORTB,3);
		// Cycle segments for test
		while(1)
		{
			PORTA=0x01; // Turn on lowest bit
			for (int i=0;i<7;i++)
			{
				_delay_ms(1000);
				PORTA = (PORTA<<1); // Shift the register left 1 bit
			}
			PORTA=0x00;
			_delay_ms(1000);
		}			
    }
}

Every second, it moves to the next segment. It just does this in an infinite loop. You can see we initially set PORTA to 0x01. Port A is an 8-bit register that maps directly to pins 20->11 on the MCU (port A). So we are initially setting this to 00000001 - so pin 20 will be on, outputting 5v, and the rest will be off. In our loop, we then do a "bit shift" on this register - we move all the bits in the register one place to the left. So it becomes 00000010, 00000100, 00001000 and so on. When we've shifted it 7 times, we must be at 10000000 - so we reset to 0 and start again. So you can see, nothing special here, we're just turning each pin on individually one after another.

 

I'm glad I did this, because it's shown me that some of the segments have been partially burned-out (some are dim, some are bright) and the decimal point LED doesn't light at all - probably had too many volts put through it.

 

I suspect this is from a long time ago when I first started messing with these things and was a bit to generous with the voltage I pumped into the poor thing. Anyway, it's enough to continue for now, but I'll need to order a new one to get a feel for the correct brightness.

  • Like 1

Share this post


Link to post
Share on other sites
alexcrosse

<3 picoscopes! haha. Looks like a good project mate :)

 

remember - nylon knobs add 10bhp.

Share this post


Link to post
Share on other sites
brumster

Ooo, where do I get a nylon knob from :) ?

Share this post


Link to post
Share on other sites
alexcrosse

your cnc mate! lol. Or p mason engineering stock nylon and will machine it for you :)

Share this post


Link to post
Share on other sites
rallyeash

Quiafe do nylon knobs

Share this post


Link to post
Share on other sites
brumster

Results of testing.... you can see the issue with brightness on some segments...

 

 

I have one explaining the breadboard but I'm approaching my broadband limit so will have to upload it after midnight :-S

Edited by brumster

Share this post


Link to post
Share on other sites
brumster

Here you go... bit of a description of the bits and bobs on it. For seasoned veterans of the AVR world, I know it's a bit mickey mouse and I probably get some terminology wrong, but I'm trying my damndest to keep it simple :-S !!

 

http://youtu.be/47DYU6Ko3jc

  • Like 1

Share this post


Link to post
Share on other sites
c_robinson

get a walnut knob ala the maxi's!

  • Like 1

Share this post


Link to post
Share on other sites
TT205

Thanks for going to the effort - very interesting

Share this post


Link to post
Share on other sites
brumster

Well, half term stopped things for a bit but time to pick this back up again.

 

Firstly, the dim characters - that was actually a code error. In my earlier code I'd used 0x00000001 and so forth, which was a bit silly of me - it should have been 0b00000000. Basically, 0x is to specify hexadecimal values into a register/variable, but to specify a bit pattern (binary) I needed to be using the 0b prefix. Just a silly error but one that I failed to spot at the time.

 

Now that the registers are correctly specified, it all works correctly - wasn't a problem with the display at all!

 

I tried using the PCM feature to vary the intensity of the LEDs tonight, but this approach doesn't work in my current configuration. I don't think the transistors in the darlington array are up to switching quite so fast. I need to dig out the spec sheets and figure out what's going on, but to be honest, I think it's not worth the effort; everyone is going to be happy with 2 levels of brightness (bright for daytime use; dim for night) and these values can be set with a simple pair of resistors. I'll then use the single transistor to switch between the high and low brightness settings. It will be a lot simpler and just as effective - and the transistors will already be getting a hammering from being switched rapidly to display the segments anyway, so another high-frequency switching of them isn't going to help matters.

 

More soon...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×