Searching \ for 'interfacing pic16f84 to ADC and DAC' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=adc
Search entire site for: 'interfacing pic16f84 to ADC and DAC'.

Truncated match.
PICList Thread
'interfacing pic16f84 to ADC and DAC'
1999\12\02@103152 by Sarang S. Dalal

flavicon
face
<x-flowed>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.)

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

</x-flowed>

1999\12\02@111254 by Michael Rigby-Jones

flavicon
face
part 0 4533 bytes
<P><FONT SIZE=2 FACE="Arial">I need to control an ADC and DAC with two separate microcontrollers.</FONT>
<BR><FONT SIZE=2 FACE="Arial">The ADC is a 4-channel 12-bit MAX1246, while the DAC is a 4-channel</FONT>
<BR><FONT SIZE=2 FACE="Arial">12-bit MAX537.&nbsp; My application is transmitting three channels of</FONT>
<BR><FONT SIZE=2 FACE="Arial">analog data over a single wireless digital link.&nbsp; The digital link</FONT>
<BR><FONT SIZE=2 FACE="Arial">has a maximum speed of 19200 bps.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">The ADC needs to be sent an 8-bit configuration byte before the</FONT>
<BR><FONT SIZE=2 FACE="Arial">microcontroller receives each 12-bit conversion.&nbsp; The DAC needs to be</FONT>
<BR><FONT SIZE=2 FACE="Arial">sent a 16-bit word, containing 8 bits of configuration and 12 bits of</FONT>
<BR><FONT SIZE=2 FACE="Arial">data.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Ideally, I would like to have the ADC hooked up to one</FONT>
<BR><FONT SIZE=2 FACE="Arial">microcontroller, which would put together the 16-bit word for the DAC</FONT>
<BR><FONT SIZE=2 FACE="Arial">and send it over the digital link.&nbsp; Another microcontroller would</FONT>
<BR><FONT SIZE=2 FACE="Arial">receive the data and pass it on to the DAC.</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">I tried using my lab's BASIC Stamp II -- I was able to communicate</FONT>
<BR><FONT SIZE=2 FACE="Arial">with the converters just fine, but the BASIC interpreter simply</FONT>
<BR><FONT SIZE=2 FACE="Arial">couldn't process commands fast enough to yield a decent sampling</FONT>
<BR><FONT SIZE=2 FACE="Arial">rate.&nbsp; (I need at least 400 Hz total, and would like 1200 Hz.)</FONT>
</P>
</UL>
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Well, you can't achieve 1200Hz.&nbsp; 19200/16=1200, but that dosen't allow for any framing bits (start stop etc).&nbsp; You are going to have to send additional information to identify the channel being transmitted.&nbsp; 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.</FONT></P>

<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Have you actually used the TX/RX yet?&nbsp; 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.&nbsp; The simple RX's do not like long runs of of consecutive 1's or 0's.&nbsp; 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.</FONT></P>

<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">You should be able to get a pretty good speed improvement over a STAMP, but you will not reach your prefered target.</FONT>
</P>

<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Regards</FONT>
</P>

<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Mike Rigby-Jones</FONT>
</P>
<UL>
<P><FONT SIZE=2 FACE="Arial">My lab also has a 10 MHz PIC16F84.&nbsp; Would this microcontroller be</FONT>
<BR><FONT SIZE=2 FACE="Arial">sufficient?&nbsp; I'm new to assembly language, so if I'm going to invest</FONT>
<BR><FONT SIZE=2 FACE="Arial">the time into learning, I want to be sure that it will work!&nbsp; Also,</FONT>
<BR><FONT SIZE=2 FACE="Arial">any pointers to code for getting started would be appreciated...</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Thanks in advance,</FONT>
<BR><FONT SIZE=2 FACE="Arial">Sarang Dalal</FONT>
</P>
</UL>
</BODY>
</HTML>
</x-html>

1999\12\03@015710 by Dr. Imre Bartfai

flavicon
face
Hi,

I did not recompute your data, I believe them. Here is also some advices:

1. You can try the BS-IISX stamp, it is considerably faster.
2. If you have some experiences in Basic, can try PicBasic other PicBasic
Pro from mElabs. They are not very cheap, though, but IHMO they are they
price worth (I use PicBasic Pro and I am satisfied with it.)

3. Consider using PIC with built-in ADC if:
  8-bit ADC is sufficient: take the 16C7xx series, e. g. 16C711
 10-bit ADC needed: take the new 16F87x series. They are also Flash
  memories, which can give you the advantage to omitting the windowed
  part.

  Furthermore, the DAC can be replaced with built-in PWM (may be with
  additional MUX) in that parts (except 16C711, buth the bigger ones
  e. g. 16C72 can do it.)

I hope this helps.

Regards,
Imre


On Thu, 2 Dec 1999, Sarang S. Dalal wrote:

{Quote hidden}

1999\12\03@035458 by Short, Evan

flavicon
face
part 0 3021 bytes
<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Unless I'm misunderstanding, I think your bottleneck here will be the speed of the serial link. At 19200 bps, you can send only 960 2-byte packets per second, so a sample rate of 1200 Hz would be out, unless you use some form of compression. Otherwise, though, the PIC should be able to handle the operation, as long as it doesn't have much else to do.</FONT></P>

<P><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">Evan</FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Tahoma">--------------------------------------------------------------</FONT>
<BR><FONT SIZE=2 FACE="Tahoma">Evan Short - Electronics Engineer</FONT>
<BR><FONT SIZE=2 FACE="Tahoma">Ferrari Gestione Sportiva - Maranello, Italy</FONT>
<BR><FONT SIZE=2 FACE="Tahoma">--------------------------------------------------------------</FONT>
</P>
<UL>
<P><FONT SIZE=1 FACE="Arial">{Original Message removed}

1999\12\03@103823 by Craig Beiferman

flavicon
face
part 0 5098 bytes content-type:text/plain; charset=US-ASCII (decoded 7bit)




______________________________ Reply Separator _________________________________
Subject: Re: interfacing pic16f84 to ADC and DAC
Author:  pic microcontroller discussion list <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> at
INTERNET
Date:    12/3/99 9:58 AM


Unless I'm misunderstanding, I think your bottleneck here will be the speed
of the serial link. At 19200 bps, you can send only 960 2-byte packets per
second, so a sample rate of 1200 Hz would be out, unless you use some form
of compression. Otherwise, though, the PIC should be able to handle the
operation, as long as it doesn't have much else to do.

Evan


--------------------------------------------------------------
Evan Short - Electronics Engineer
Ferrari Gestione Sportiva - Maranello, Italy
--------------------------------------------------------------

> {Original Message removed}

1999\12\03@171959 by John Mullan

flavicon
face
Sorry, I haven't taken the time to actually calculate the speed you need,
but you wouldn't waste your time learning PIC assembly.  The variety of PIC
available all use pretty much the same instruction sets.

As for the 10Mhz PIC16F84, I wouldn't think that you will get enough
"horsepower" to meet the challenge.  But like I said, there are a great
variety of PIC chips and one of them will meet your needs.  Try one with
built in ADC.

John Mullan


{Original Message removed}

1999\12\06@090728 by Craig Beiferman

flavicon
face
    DON'T try one with a built in ADC.

    Pic chips cannot correctly sample data, as the output pins are
    changing. (I assume you'll be transmitting as your sampling)

    The power surge as the output pin changes, adds noise to the
    input.

    -Craig Beiferman



______________________________ Reply Separator _________________________________
Subject: Re: interfacing pic16f84 to ADC and DAC
Author:  pic microcontroller discussion list <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU> at
INTERNET
Date:    12/3/99 5:19 PM


Sorry, I haven't taken the time to actually calculate the speed you need,
but you wouldn't waste your time learning PIC assembly.  The variety of PIC
available all use pretty much the same instruction sets.

As for the 10Mhz PIC16F84, I wouldn't think that you will get enough
"horsepower" to meet the challenge.  But like I said, there are a great
variety of PIC chips and one of them will meet your needs.  Try one with
built in ADC.

John Mullan


{Original Message removed}

1999\12\07@004521 by paulb

flavicon
face
Craig Beiferman wrote:

>  Pic chips cannot correctly sample data, as the output pins are
>  changing. (I assume you'll be transmitting as your sampling)
>  The power surge as the output pin changes, adds noise to the input.

 Sounds eminently sensible.
--
 Cheers,
       Paul B.

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...