My question is whether a 10 MHz PIC16F84 would be fast enough for my
application.
I need to control an ADC and DAC with two separate microcontrollers.
The ADC is a 4-channel 12-bit MAX1246, while the DAC is a 4-channel
12-bit MAX537. My application is transmitting three channels of
analog data over a single wireless digital link. The digital link
has a maximum speed of 19200 bps.
The ADC needs to be sent an 8-bit configuration byte before the
microcontroller receives each 12-bit conversion. The DAC needs to be
sent a 16-bit word, containing 8 bits of configuration and 12 bits of
data.
Ideally, I would like to have the ADC hooked up to one
microcontroller, which would put together the 16-bit word for the DAC
and send it over the digital link. Another microcontroller would
receive the data and pass it on to the DAC.
I tried using my lab's BASIC Stamp II -- I was able to communicate
with the converters just fine, but the BASIC interpreter simply
couldn't process commands fast enough to yield a decent sampling
rate. (I need at least 400 Hz total, and would like 1200 Hz.)
Well, you can't achieve 1200Hz. 19200/16=1200, but that dosen't allow for any framing bits (start stop etc). You are going to have to send additional information to identify the channel being transmitted. If the three channels are always sent in sequence, then I gues you can get away with some kind of identifier at the start of the block.
Have you actually used the TX/RX yet? Unless these devices have some kind of packet controller built in, then you will may need to come up with some kind of encoding scheme to get a reasonably balanced serial stream. The simple RX's do not like long runs of of consecutive 1's or 0's. Also bear in mind that the 16F84 has no built in uart, you will have to do both the SPI (for the DAC and ADC) and the RS232 (or whatever you choose for the radio side) in software.
You should be able to get a pretty good speed improvement over a STAMP, but you will not reach your prefered target.
Regards
Mike Rigby-Jones
My lab also has a 10 MHz PIC16F84. Would this microcontroller be
sufficient? I'm new to assembly language, so if I'm going to invest
the time into learning, I want to be sure that it will work! Also,
any pointers to code for getting started would be appreciated...
Thanks in advance,
Sarang Dalal