Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/19/04 09:57
Read: times


 
#72783 - RE: 3-8 line decoder
Responding to: ???'s previous message
Keil Ruben said:
How do go about using the 74C138 3-to-8 line decoder in your c code?

A 74C138 is a hardware component - you cannot use it in your 'C' source code! ;-)
(unless you're using 'C' as a Hardware Description Language, HDL)

Keil Ruben said:
How do you use the adress lines A13, A14 and A15 to select a specific perifiral?

Look at the schematic in Michael's post:
See how the address lines A13-15 are connected to the decoder's A,B,C input lines, and the Y0-7 outputs are used to select the different peripherals (in Michael's case, different memory chips)

Keil Ruben said:
how do you tell the compiler to go to a specific adress

There are several possibilities:

* Use a pointer - see your compiler manual for details of its pointer implementation to cope with the 8051's different memory spaces.
(Note that this is effectively what Keil's XBYTE, etc, macros do - see the Keil manual)

* Use the Linker to locate a variable at the required address - see your Linker manual.
(this has the advantage of keeping hardware- and compiler-dependencies out of your source code)

* If you are using Keil, try the _at_ keyword extension - see the Keil C51 manual.
(this has the disadvantage of making your source code both hardware- and compiler-dependant!)

List of 4 messages in thread
TopicAuthorDate
3-8 line decoder            01/01/70 00:00      
   RE: 3-8 line decoder            01/01/70 00:00      
   RE: 3-8 line decoder            01/01/70 00:00      
   RE: 3-8 line decoder            01/01/70 00:00      

Back to Subject List