I am confused with the I/O clock input mentioned in this datasheet: http://www.ti.com/lit/ds/symlink/tlc1543.pdf
Do I need to output clock from this adc to 8051 or do I need to use an external crystal for both the TLC1543CN and 8051 together?
Answer
It's not that confusing to read. There is a diagram near the end of the datasheet that shows a nominal arrangement between the a CPU (8051) and the ADC IC. And there is a section called "DETAILED DESCRIPTION" which makes things a lot clearer.
In general, the I/O Clock (which is really an input) line is used by your 8051 to "clock out," in serial mode, the prior reading. Your code is supposed to operate this clock (using a pin configured as an output pin) and to operate the chip select line (using another pin, if you have one, also configured as an output pin) and while that is happening also observe the data line (using yet another pin configured this time as an input.) You also may need to operate the address input pin for a part of the time you are also operating the clock line (using yet another 8051 pin configured as an output.)
The clock line also triggers other actions along the way, such as charging a capacitor array, or starting the next conversion near or at the end of a short series of clock cycles. The rate at which you clock this line, it says, cannot exceed 2.1MHz. It's not likely you'll need it to be that fast, as the conversion time appears to be about \$\le\$21\$\mu\$s and you'll use perhaps at most some 16 cycles to clock out the data. So there is room. It appears you can run the I/O clock as slow as you want, too. So you can "bit bang" everything in your 8051 code (which makes bit banging really easy at the assembly level.)
There are lots of timing diagrams near the end of the datasheet which tell you what to do in each of its modes, in software. Is there something that you don't understand there? Normally, you just bit bang the clock line while also sampling (reading) the data out pin. There's more (as there is addressing involved and a chip select, for example.) But it's just minor details along the way.
EDIT: In answer to some of your comments below:
The 8051 does need a clock source. Usually, this is provided by applying a crystal between XTAL1 and XTAL2, plus a couple of tiny 30pF capacitors. I don't know which 8051 core you are using (I still have a hundred 80C32's from Intel, but I've used SiLab's [Cygnal's] 8051's too and there are more manufacturers than that), but you may also be able to drive one of those with a separate oscillator. You will have to check the datasheet for the device to find out various options. But you DO have to have a working hardware oscillator that drives the 8051 to make it work. There is no avoiding this requirement of the 8051. It needs a clock source of some kind. You cannot just apply power and expect it to run correctly.
Once the 8051 runs correctly, though, it's NOT the case that your ADC IC needs to have its clock line driven by such an oscillator. In fact, few would consider doing that and I don't even want to consider whether or not someone could make it work. (I'd have to read the ADC IC docs more than I want to, right now.) Instead, you just write software to manage the lines. You will have to program things so that the pins are properly configured, first. Then you will have to write lots of other software, some of which will be a subroutine or main-line bit of code that operates in a loop designed to extract a prior reading while initiating the next one. This is just very standard fare. You wire up a clock line, a data line, an address line in this case, probably a chip select (though this is optional, I believe) and perhaps something I've missed writing just now. Your software will operate ALL of them, changing the output pins properly and reading the input pin (data) at appropriate moments. The lucky thing here is that since you are driving all the other lines, you know EXACTLY when to read the data line. So it's really very, very easy to do.
None of this deals with the analog input lines. Given the difficulties you are having understanding something this simple and more "software-ish" than hardware-like, then I really, really worry about how you are going to properly design anything to operate the analog input lines -- where there is no question you will need to read other parts of the datasheet that does deal with hardware knowledge you need and will require some design knowledge on your part. Even the most basic analog inputs need some kind of conditioning and probably also protection.
Asking, "do you mean by inputting a clock to xtal1 and then outputting it through xtal2 to adc clock input," tells me that you are in for a world of hurt here. It's so completely off where your mind needs to be that I fear much more than just you figuring out how to clock out an address and clock in some data.
It's basic stuff that you want to do. But it is basic stuff that does depend on some fundamental knowledge you don't appear to have yet acquired. And if you are worried about a two week shipping delay, then this tells me you are in way too much of a rush for the learning you have ahead. Slow down. Allow yourself time to slowly acquire what you need to learn about. This is a great project in that sense, I think, in order to lift yourself up by your own bootstraps. But it will take time. You need to be prepared for that.
No comments:
Post a Comment