8-bit uC question

ErnieM

Joined Apr 24, 2011
8,377
Yeah, it's really needed, and depending on who you ask you'll get different answers, and they are all probably acceptable.

Big caps are good at delivering high currents but may be slow to get there. Small caps are faster but run out of stored energy faster. Using both gets you closer to an ideal cap.

My mix is 10uF with 0.1uf or even 0.01 uf; typically I'll have one 10/0.1 pair at the regulator and toss in a 0.01 around every device I am concerned with.

While bypass caps are essential, it's not quite an exact science how you pick them. It's not uncommon to design in space on a PCB for an overkill of caps, then just populate the ones you think you really need after testing.
 

Thread Starter

rasosina

Joined Jun 30, 2010
25
oh i see. makes sense, thanks ernie.

I actually just got the TI launchpad for $4.30 and i'm playing around with it and learning how the IO works and how to program it, and i'm assuming that programming a pic will be very similar to this (if not the same since they're both programmed in C).

now, i'm just wondering how to set up my 'POT' user input circuit. i've noticed that almost all of the datasheets that i've gone through don't have the pins of the pots labeled or provide a schematic diagram to know which pin is which. is there a particular reason for that?

and this is the way i was thinking of setting it up:



but now i'm wondering if it's going to dissipate too much power having it like that? also, what considerations should i take into account when i'm trying to size the pot? just make sure that the pin will get enough current to be able to do the ADC?

thanks
 

Attachments

ErnieM

Joined Apr 24, 2011
8,377
The short answer is probably just use a 10K pot and don't worry.

Long answer is typically pots have 3 terminals on them, the middle one being the wiper. As I have transistor dyslexia I have to re-wire pots 2-3 times until I get them to increase value in when turned the way I want.

The A2D input on the micro is a high impedance input so you can ignore it's current, so you get the pot's resistance across Vcc and Vcc/ R as it's current.

Last point is a bit obtuse: You want a maximum source impedance when driving a D2A input, typical values run like 5 to 10 K ohms. The impedance of a pot is the resistance R/2 maximum, which is why the short answer was 10K.
 

Thread Starter

rasosina

Joined Jun 30, 2010
25
oh ok. so if i've got a 5V supply the 10k pot will dissipate around 0.5mA which is pretty good i guess.

but back to the Display modules and controllers, if i have a 7-seg display with 4 digits that has like 34 pins, with 32 segments (the other 2 pins being common) do i need to find a pic that has at least 32 io points? i remember you said it depends on the type of display, but the type i have has a common node/pin connected to all segments and each segment is connected to each pin of the display module. is there any way i can get around from having to use a 34+ io pin micro with this display module, and without having to use 2 separate micros?
 
You can cascade four 74hc595's for each 7 segment digit, which essentially parallels all the inputs and outputs excepting the OE (output enable) pin. Use a small signal npn transistor, or nfet like the 2n7000, on each OE pin to ground. This creates a multiplexed display by turning the first '595 on, shift data out, wait say 1ms, then off, then repeat for next '595. So seven pins are required I believe, 1 ea. (Latch, Clck, Data) and 4 for the OE pins. Should be plenty of schematics on the web or data sheets.

EDIT: Cost and board space may point you in the direction a micro that uses an 8 bit port instead of the '595's, and the extra 4 pins for the multiplex control.
 
Last edited:

ErnieM

Joined Apr 24, 2011
8,377
You can cascade four 74hc595's for each 7 segment digit, which essentially parallels all the inputs and outputs excepting the OE (output enable) pin. Use a small signal npn transistor, or nfet like the 2n7000, on each OE pin to ground. This creates a multiplexed display by turning the first '595 on, shift data out, wait say 1ms, then off, then repeat for next '595. So seven pins are required I believe, 1 ea. (Latch, Clck, Data) and 4 for the OE pins. Should be plenty of schematics on the web or data sheets.
Well... close, but not quite correct as these are LCD displays that need a square wave voltage (but little current) to drive them, so no NPN or FET's needed. Just 3 lines (Data, Shift, Latch) would be needed to drive 4 (or more) 74HC595's, which are a good choice, each one gives you the 8 lines needed to drive each digit. One more PIC pin would serve as the common driver, so you could run the display off a PIC and 4 of these latching shift registers.

(I have one brain cell firing off telling me the Latch line could also serve as the Common driver, but I have to wait for my other brain cells to fire and acknowledge that thought.)

As you drive the entire display continuously there is no need to control the output enables, just tie em all off so the output is always valid.

Using something else like a port expander leaves you with the problem of setting all 32 (33) pins at the same time.
 
Well... close, but not quite correct as these are LCD displays that need a square wave voltage (but little current) to drive them, so no NPN or FET's needed. Just 3 lines (Data, Shift, Latch) would be needed to drive 4 (or more) 74HC595's, which are a good choice, each one gives you the 8 lines needed to drive each digit. One more PIC pin would serve as the common driver, so you could run the display off a PIC and 4 of these latching shift registers.
Quite right, can't remember yesterday at the moment:). Mixed up using a single '595 that is multiplexed, with cascading four together, mybad.

Using the single '595, or a single PIC port, would be dependent on individual control of the source, for each 7 segment. When I think of a four digit seven segment display I think of one of these http://www.sparkfun.com/products/9483 ? I'm easily confused. A recommendation was already provided for the bare glass lcd, it can handle 60 lcd segments in a 28 pin device.

It would be helpful for the O.P. to provide a link to the datasheet of the display being considered.
 
@nickelflipper: I knew you knew that <grin>

The display picture I posted that OP said "looks like his" is this one.

I also found a nice online project for Driving static LCD displays.
O.K. that matches up with the pinout description given by rasosina. So for the PIC16f917 in the 1:2 MUX mode, that would be 16 segment pins, 2 com pins, and 2 or 3 voltage bias pins, for a total of 20-21 if I read the data sheet right.
 

Thread Starter

rasosina

Joined Jun 30, 2010
25
hmm.. good thing i asked because i've been applying constant voltage to the segments of the display. so you're saying that if i want to display a 1, i'd have to toggle the segments b, c and common back and forth between gnd and Vdd? the way i've been doing it right now works fine but i guess it would ruin the display early on right? the problem is that the datasheet of the display never said anything about applying square wave to operate, in fact it doesn't even talk about the operating voltage of the display :confused:.

so to drive the lcd itself using the square wave method it looks like i have a couple options:

- i could either use a 34+ io pin micro and drive all segments using the micro (like the PIC16F946),
- or use 4 shift registers and a cheap generic pic with as little as 8 io pins as nickelflipper pointed out
- or instead of the 4 generic ones i could use a 4 digit 7-segment display driver like this

and judging from the prices on digikey.com the first option seems like the cheapest and easiest (unless i'm missing something major, which is very likely).

thanks again for the help guys.
 
@rasosina
I always thought of the lcd as being ac driven, haven't ever really looked into it.

To save a few pennies there are newer LCD driver chips like the PIC16f1946, or the PIC16193X series if you want to mux the lcd pins. The newer devices have a 3V internal LCD bias so you can save a few pins.

I have a 16f917 on a PICkit 2 44 pin demo board, plus a Lumex 4 digit laying around that I didn't use on a project. Going to try it in 1:2 mux mode. It's taking a while to figure out all the segment hook-ups!
 
sweet. thanks for the recommendation nickelflipper.
Your welcome. You've inspired me to dig out an unfinished project.

Well so much for muxing my 4 digit Lumex display, it's strictly static. Got confused when the abbreviated data sheet mentioned 1/2 Bias, and took that for 1/2 mux:rolleyes:. So make that a static 3 1/2 digit display with the 16f917.
 
Top