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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/10/01 15:58
Read: times


 
#9181 - RE: A/D converter
[ movx @r0,a ]
will present the contents of the register r0 onto the port pins p1.0 through p1.7 to externally selected the ADC chip in your circuit. The contents of the accumulator is then presented to the pins, P0.0 through p0.7 and the WR signal on p3.6 cycles to latch the data into the ADC. Port P0 must have pull-up resistors on its 8 pins (more on that below). Port p2.x will be unaffected by the command. If you use 16 bit addressing for other external components, you may have problems using this command.

[ movx a,@r0 ]
will present the contents of the register r0 onto the port pins p1.0 through p1.7 to externally selected the ADC chip in your circuit. Port P0.0 through p0.7 are held at high impedance so they can be used to input data from the selected external device, the ADC. The RD signal on p3.7 cycles to latch the data from the ADC, onto the data bus (Port P0) and the microprocessor reads that data and loads it into the accumulator.

THINGS THAT CAN GO WRONG:
------------------------

I'll assume first that the program is to run on a circuit that has been designed, built and approved. I therefore can assume that no hardware errors exist, unless you inform me otherwise.

First validate that the board is not designed to do 16 bit external addressing. This would use P1 and P2 for addressing and chip select enabling. *IF* the board uses 16 bit addressing, then you may use [ movx a,@dptr ] commands for less confusion. In 16 bit addressing circuits, you can still use [ movx a,@r0 ] commands for certain advantages, but you must write an appropriate external chip selection pattern on the bits of port 2 (P2) that are used by the circuit.

I'll assume now that you are using only 8 bit addressing, Port P1 to address and chip selected external components. Now you must load the bit pattern that when loaded into Port P1.0 through P1.7, activates the chip select of your ADC and no other chip at the same time. If this is done properly, you are sucessfully addressing your ADC.

You may still have problems if your circuitry doesn't have pull-up resistors along Port P0.0 through P0.7. It is commonly overlooked by novices when designing that Port P0 uniquely requires pull-up resistors (about 3.3K to 4.7K resistors tied between the port pin and +5Vdc). If the resistors are absent, the data bus usually won't present a reliable HIGH or ONE logic state.

A more likely problem is the protocol for the ADC. Some require special command sequences through ADC registers before they will collect data. I can't offer assistance here without knowing the actualy ADC part number.

I'll pause here and await more information if the above didn't help enough.

Good Luck,

aka j

http://www.geocities.com/mingpzong

List of 18 messages in thread
TopicAuthorDate
A/D converter            01/01/70 00:00      
RE: A/D converter            01/01/70 00:00      
RE: A/D converter            01/01/70 00:00      
RE: A/D converter            01/01/70 00:00      
My Circuit Design            01/01/70 00:00      
RE: My Circuit Design            01/01/70 00:00      
RE: My Circuit Design            01/01/70 00:00      
Sensors            01/01/70 00:00      
Sensors - Suppliment            01/01/70 00:00      
RE: A/D converter            01/01/70 00:00      
RE: A/D converter            01/01/70 00:00      
RE: A/D converter            01/01/70 00:00      
RE: A/D converter            01/01/70 00:00      
RE: A/D converter            01/01/70 00:00      
"Bit-bang" A/D converter codings            01/01/70 00:00      
RE: "Bit-bang" A/D converter codings            01/01/70 00:00      
RE: "Bit-bang" A/D converter codings            01/01/70 00:00      
ADC0844 (with multiplexer options)            01/01/70 00:00      

Back to Subject List