PIC instead of 74LS138

Thread Starter

Tasp

Joined Aug 10, 2008
45
Hi guys,

I'm very new to electronics especially PIC's. So please excuse any ignorance.

I wanted to use a 74LS138 3 to 8 line decoder, however when the inputs change the outputs turn off (non latching), I need them to latch until the input is removed. I have considered using 74LS74's before finally going into ULN2308A for the final output to LED's, but it seems to get messy with 3 IC's to do a reasonably simple task.

To resolve this I was pointed in the direction of PIC's but with no real understanding I need a few pointers.

Can it be done?

I was looking at the PIC16F887 (40pin) as this gives me 4 banks of 8 Inputs/Outputs?
So using 9 as inputs could have 24 as outputs?
Is this an ok chip or too big/many features for what I want?

Seen as I have no programmer either what do you think about this;
http://cgi.ebay.co.uk/PIC-Developme...al_Components_Supplies_ET?hash=item414d40e809

I have programmed a lot in BASIC before such as Liberty BASIC so learning 35 commands shouldn't be that hard?!

Thanks for your help.

Dave
 

Markd77

Joined Sep 7, 2009
2,806
It's possible but there are a few considerations.
It will be pretty quick but not as quick as the logic ICs
Although the maximum current for a pin is 25mA the total current for the PIC is 90mA so you may still need the ULN2803s.
Have a look at the 35 commands first! You can download Microlab MPlab software for free which has a simulator and debugger so you can try them out.
 

retched

Joined Dec 5, 2009
5,207
I have programmed a lot in BASIC before such as Liberty BASIC so learning 35 commands shouldn't be that hard?!
There are only 26 letters in the English Alphabet, but can you spell all the words and put them in every order? Not to mention the math.

Binary only has 2 ... you can use that..

;)
 

spinnaker

Joined Oct 29, 2009
7,830
Hi guys,


Seen as I have no programmer either what do you think about this;
http://cgi.ebay.co.uk/PIC-Developme...al_Components_Supplies_ET?hash=item414d40e809

I have programmed a lot in BASIC before such as Liberty BASIC so learning 35 commands shouldn't be that hard?!

Thanks for your help.

Dave
That is a development board. I did not see anything about it being able to program PICs. You will want to get a programmer like the PICKit 2 or PicKit 3. Don't bother with the cheaper programmers. The debug capabilities of the Pickit is well worth the extra money.
 

t06afre

Joined May 11, 2009
5,934
You can also program your MCU in Both C and Basic. You will find good free compilers. But a waring. Even if you program in C or Basic. You have to download and read the data sheet so you understand the inner working. Like turning off analog functions then you do not need them.
 

rogs

Joined Aug 28, 2009
279
Hi guys,
I wanted to use a 74LS138 3 to 8 line decoder, however when the inputs change the outputs turn off (non latching), I need them to latch until the input is removed.
Using a PIC is probably overkill for a relatively simple function like this, although it could be a useful introduction, if you're intending to look towards software based projects for the future.

Have look at http://www.fairchildsemi.com/ds/MM/MM74HC259.pdf

3 to 8 plus latch. Simpler for your current project I would think.
 

Thread Starter

Tasp

Joined Aug 10, 2008
45
Guys, thank you all for your reponses, they have all come in very handy!

@rogs, this 74HC259, although this latches it resets all the outputs rather than one at a time.

@spinnaker, glad you spotted that, it looks like I'll be going for the Pickit 2 seems to have more ability than the 3?

@retched, I understand what your saying, I understand learning a new lang will take time.

@markd77, I did still have the intention to use the ULN2308 as well, but thanks for comfirming this.

@t06afre, I think your right perhaps this PIC16F59 would be more suited as it appears a lot simpler.
 

retched

Joined Dec 5, 2009
5,207
I was thinking about that post today... I was thinking how much easier it would be to have hundreds of commands. That way you don't have to figure out cryptic combinations of the 35 commands to do the thousands of things you need to do.

And boy, there are a lot.
 

AlexR

Joined Jan 16, 2008
732
I don't know about hundreds more but certainly a few dozen more commands (something like the 6800 instruction set) would make make assembler programming a lot easier.
The "only have 35 commands to remember" line pushed by Microchip is nothing more than a marketing ploy used to excuse the lack features in the PIC instruction set.
 

spinnaker

Joined Oct 29, 2009
7,830
Guys, thank you all for your reponses, they have all come in very handy!



@spinnaker, glad you spotted that, it looks like I'll be going for the Pickit 2 seems to have more ability than the 3?
Actually the PICKit 3 is better the 2 is supposed have support dropped but they have been talikng about that for a while now.
 

AlexR

Joined Jan 16, 2008
732
From what I can gather support for the PICkit2 has in fact ended. No more new chips will be supported by PICkit2.
At the moment PICkit2 is the better product since as well as MPLAB programming and debugging functions, it is supported by a stand-alone GUI that allows programming, a simple logic analyser and a comms data analyser.
PICkit3 can for the time being only be used through MPLAB for programming and debugging. There is however a stand-alone GUI in the pipeline for PICkit3 and when that comes out (due at the end of this quarter whatever that means, end of the month??) it should make PICkit3 the product to buy.
 
Top