Hi Joe
A couple more questions if you have the time. I am starting to learn
and am rapidly approaching the point of where my imagination is
becoming dangerous in its scope of possible projects.
I have 10 analog inputs and 2 pulses I need to count. I have picked up
a smattering of assembly for the 8051 chain and I should be able to
code it as you pointed out above. I see there is another chip the 808
which has 8 analog inputs . Is one possibility to get two of these
together and then the PC sends a signal across the serial line such as
'5' which the 8051 picks up via the serial interrupt then knowing
sensor '5' is on the first 808 chip selects this chip, sends across
the appropriate 3 bits for the appropriate chanel reads and copies
over the signal and then the 8051 copies it from port (1 for example)
and then sends it to SBUF?
Yes, that is well possible. So far I haven't done anything
with the 8051 architecture. But when you say that there
is this 808 that can be attached to the 8051 bus, it should
be well possible to attach more than one of these.
As for the data transmission protocol, your proposal would
be alright as well. An alternative might be that the micro
controller permanently samples all 10 channels in a round-robin
fashion. Once it got a sample, it would send the data
preceeded by a header. Depending on the header the host
computer can decide to which channel the sample belongs to.
I used such a fashion in a sensor design I did recently
(
http://www-user.tu-chemnitz.de/~mtr/plane_sensor_page/)
But perhaps your on-demand sample request is more suitable
for your application.
I also heard about the 8031 chip which has a built in serial line.
Does this mean the 8031 can be hooked directly to the max232? And how
does one determine which analog signal to chose on the 8031 (in the
808 there is an ALE and ADD1,ADD2,ADD3) and how does one begin and end
the conversion process?
Again, I have to admit that I'm not yet familar with the 8051
architecture. All I know is that the 8051 has a conventional
external bus and IO registers are very likely mapped into the
memory address space. The AD-converter has very likely some
register to select a certain analog input for conversion
(I doubt this device has 8 AD-converters inside), some other
control-and-status registers, and a data register that holds
the result after conversion. For datails about this, you should
consult the appropriate data sheets.
Probably you need some external glue-logic for address decoding
in order to attach external devices to the 8051 bus.
I don't know whether there are 8051s that have everything
integrated what you need. I checked the PIC pallet and there
are several devices that include all you need in a single chip.
For instance:
PIC16C774 (10 12Bit AD, UART)
PIC18C18F2320 (10 10Bit AD, UART)
Check out
www.microchip.com for details.
Of course, dealing with an architecture that is new for you might
cause some difficulties.
Regarding the serial line: Yes, these UARTs usually have a
simple digital input and output (RX and TX) and all that
needs to be done is to feed them appropriately through this
MAX232 (or some alternative device).
Regards,
Mario