Reply by Vasile Surducan March 8, 20062006-03-08
--- In piclist@picl..., "rtstofer" <rstofer@...> wrote:
>
> --- In piclist@picl..., Fiona Soon <fionasoon2001@> wrote:

> >   Now the question is, if i want to write
codes for 2 ADC module,
> (yes, i know PIC16F877 has multiple AN0-6 input), but there is only
> one TXREG register and TX pin. How can i acquire 2 analog signal at
> the same time and send them out to two serial port? 

I'm afraid you'll probably have a problem. There is one  ADC module, 
having a multiplexing input scheme. So you can't measure two analog 
signals "in the same time" as you requested, only if you're
sampling 
and hold - exactly in the same time- those two analogic signals 
outside the pic and then read succesively the voltage from the each 
sampling capacitor with two different analogic inputs. Using two 
serials does not solve your problem as long as the time required for 
one AD measurement is about 20uS.
So anyway using one PIC, you'll have at least (20uS + memory storing 
time) between two succesive (and not simultaneous) AD readings. 

greetings,
Vasile
	
Reply by Fiona Soon March 6, 20062006-03-06
Thanks guys!
 
I think i will opt to choose a PIC with 2 UART which is a more trivial solution.
 
Thank you.


Chris <f...@aol.com> wrote:
--- In p...@yahoogroups.com, Fiona Soon <fionasoon2001@...> wrote:
>
> Hello Chris, Chart and Cullins,
>   
>   Of course, Fiona is a girl!
>   
>   I have written codes for one channel 10bit ADC by setting all the
relavent register (SPBRG, ADCON0, RCSTA and etc.) and move two packets
of data out (8 bit and 2 bit respectively) to the TXREG through the TX
pin.
>   
>   Now the question is, if i want to write codes for 2 ADC module,
(yes, i know PIC16F877 has multiple AN0-6 input), but there is only one
TXREG register and TX pin. How can i acquire 2 analog signal at the
same time and send them out to two serial port? Don't i need two TX pin?i think that i understand your concept.
So okay it's a case of using a pic with 2 Uarts and nearly all of them
have multichannel A/D's

If you can attach your serial data receivers to the same output though
you can get a lot of mileage out of what you have.....

Read A2D input 0 > Saved_A2D_0
Read A2D input 1 > Saved_A2D_1
Read
.
.
.
.

Movf Saved_A2D_0 > txreg
Movf Saved_A2D_0 > txreg
Movf
.
.

Loop back to the top after a pause...don't want to swamp the serial bus

If your serial receivers are something of your own design they can all
share the same serial line, either by looping through the TX-RX UART on
each device or by buffering the output from the sender and connecting
all receivers to the single buffer. The chained devices being the
preffered way because if each device knows it's own position in the
chain it knows which byte in the stream is relevant to itself.

Chris,
(Currently chaining upto 255 16F690's)


Yahoo! Mail
Bring photos to life! New PhotoMail makes sharing a breeze.

Reply by Chris March 6, 20062006-03-06
--- In piclist@picl..., Fiona Soon <fionasoon2001@...> wrote:
>
> Hello Chris, Chart and Cullins,
>    
>   Of course, Fiona is a girl!
>    
>   I have written codes for one channel 10bit ADC by setting all the 
relavent register (SPBRG, ADCON0, RCSTA and etc.) and move two packets 
of data out (8 bit and 2 bit respectively) to the TXREG through the TX 
pin.
>    
>   Now the question is, if i want to write codes for 2 ADC module, 
(yes, i know PIC16F877 has multiple AN0-6 input), but there is only one 
TXREG register and TX pin. How can i acquire 2 analog signal at the 
same time and send them out to two serial port? Don't i need two TX pin?
> 

i think that i understand your concept.
So okay it's a case of using a pic with 2 Uarts and nearly all of them 
have multichannel A/D's

If you can attach your serial data receivers to the same output though 
you can get a lot of mileage out of what you have.....

Read A2D input 0 > Saved_A2D_0
Read A2D input 1 > Saved_A2D_1
Read
.
.
.
.

Movf Saved_A2D_0 > txreg
Movf Saved_A2D_0 > txreg
Movf
.
.

Loop back to the top after a pause...don't want to swamp the serial bus

If your serial receivers are something of your own design they can all 
share the same serial line, either by looping through the TX-RX UART on 
each device or by buffering the output from the sender and connecting 
all receivers to the single buffer. The chained devices being the 
preffered way because if each device knows it's own position in the 
chain it knows which byte in the stream is relevant to itself.

Chris,
(Currently chaining upto 255 16F690's)
	
Reply by rtstofer March 6, 20062006-03-06
--- In piclist@picl..., Fiona Soon <fionasoon2001@...> wrote:
>
> Hello Chris, Chart and Cullins,
>    
>   Of course, Fiona is a girl!
>    
>   I have written codes for one channel 10bit ADC by setting all the
relavent register (SPBRG, ADCON0, RCSTA and etc.) and move two packets
of data out (8 bit and 2 bit respectively) to the TXREG through the TX
pin.
>    
>   Now the question is, if i want to write codes for 2 ADC module,
(yes, i know PIC16F877 has multiple AN0-6 input), but there is only
one TXREG register and TX pin. How can i acquire 2 analog signal at
the same time and send them out to two serial port? Don't i need two
TX pin?
>    
>   My example code to share is in the attachment if anyone interested.
>    
>   Thank you.
>    
>   Fiona
>   

Doing a parametric search of 8 bit PICs at www.microchip.com yields 20
devices in the 18f series with dual AUSARTs or dual EUSARTs.  All have
MANY A/D channels between 11 and 16.

I suppose there is a reason you can just send the data out 1 USART by
just reading a channel, sending the data, reading another channel,
sending that data, etc.

Richard
	
Reply by rtstofer March 6, 20062006-03-06
--- In piclist@picl..., Fiona Soon <fionasoon2001@...> wrote:
>
> Hello Chris, Chart and Cullins,
>    
>   Of course, Fiona is a girl!
>    
>   I have written codes for one channel 10bit ADC by setting all the
relavent register (SPBRG, ADCON0, RCSTA and etc.) and move two packets
of data out (8 bit and 2 bit respectively) to the TXREG through the TX
pin.
>    
>   Now the question is, if i want to write codes for 2 ADC module,
(yes, i know PIC16F877 has multiple AN0-6 input), but there is only
one TXREG register and TX pin. How can i acquire 2 analog signal at
the same time and send them out to two serial port? Don't i need two
TX pin?
>    
>   My example code to share is in the attachment if anyone interested.
>    
>   Thank you.
>    
>   Fiona

Frankly, I would find a processor with the proper hardware.  Many
devices have 2 UARTS including the Atmel ATmega128 and related
devices.  I am certain that there are PICs that have 2 UARTS, as well.

However, you could always bit-bank a serial stream to any pin.  Code
for doing this is all over the Internet.  You might look over at
www.piclist.com.

Richard
	
Reply by Fiona Soon March 6, 20062006-03-06
Hello Chris, Chart and Cullins,
 
Of course, Fiona is a girl!01.gif
 
I have written codes for one channel 10bit ADC by setting all the relavent register (SPBRG, ADCON0, RCSTA and etc.) and move two packets of data out (8 bit and 2 bit respectively) to the TXREG through the TX pin.
 
Now the question is, if i want to write codes for 2 ADC module, (yes, i know PIC16F877 has multiple AN0-6 input), but there is only one TXREG register and TX pin. How can i acquire 2 analog signal at the same time and send them out to two serial port? Don't i need two TX pin?
 
My example code to share is in the attachment if anyone interested.
 
Thank you.
 
Fiona



Yahoo! Mail
Bring photos to life! New PhotoMail makes sharing a breeze.


Reply by Chris March 3, 20062006-03-03
--- In piclist@picl..., "Leon Heller" <leon.heller@...>
wrote:
>
>   ----- Original Message ----- 
>   From: JCullins 
>   To: piclist@picl... 
>   Sent: Friday, March 03, 2006 1:18 PM
>   Subject: Re: [piclist] PIC with 2 ADC module
> 
> 
>   Most pic chips that have analog will have 5 to 8 analog inputs.
>   Pic16f818, 819, 872 873, 877. There are are many more
>   than listed here. 
>    Mosf PIC16F series as listed here will be be 10 analog as well.
>   and yes you can read any one are all one after the other. takes 
approx 10us
>   for each read.
>   Jim
> 
> I think he wanted two separate ADC modules, not inputs.
> 
> Leon

I thought Fiona was a girl's name up until now ;-)

She stated a couple of mS delay between channel reads was acceptable, 
so unless the aim is to read two voltages simultaneously most pics 
with A/D will be able to handle the task.

Chris B
(Without a failing 's' key !)
GM4UCD
	
Reply by Chad Russel March 3, 20062006-03-03
Try the selector guide at Microchip.com:
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeIdt

--- Fiona Soon <fionasoon2001@fion...> wrote:

> Hello All,
>   Can someone tell me which PIC has 2 ADC module? Can they run
> simultaneously although with a few ms of delay due to program
> sequencing?
>    
>   Thank you.
>    
> 
> 		
> ---------------------------------
> Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
	My software has no bugs, only undocumented features.

Reply by JCullins March 3, 20062006-03-03
Most pic chips that have analog will have 5 to 8 analog inputs.
Pic16f818, 819, 872 873, 877. There are are many more
than listed here. 
 Mosf PIC16F series as listed here will be be 10 analog as well.
and yes you can read any one are all one after the other. takes approx 10us
for each read.
Jim
 
 
 
On 3/3/2006 12:06:09 AM, Fiona Soon (f...@yahoo.com) wrote:
> Hello All,
> Can someone tell me which PIC has 2 ADC module? Can they run
> simultaneously although with a few ms of delay due to program sequencing?
>
> Thank you.>
> -
> Relax. and follow the
> instructions>
> SPONSORED LINKS
> Microcontroller [link: groups.yahoo.
> com/gads?t=ms&k=Microcontroller&w1=Microcontroller&w2=Microprocessor&w3=Microchip+pic&w4=Microcontrollers&w5=Picmicro&w6=Pic+microcontrollers&c=6&s2&.
> sigu8D0WTcCC_wz2NML1-Q] Microprocessor [link: groups.yahoo.
> com/gads?t=ms&k=Microprocessor&w1=Microcontroller&w2=Microprocessor&w3=Microchip+pic&w4=Microcontrollers&w5=Picmicro&w6=Pic+microcontrollers&c=6&s2&.
> sig=jWbBHutp0PsKo377UAUUMg] Microchip pic [link: groups.yahoo.
> com/gads?t=ms&k=Microchip+pic&w1=Microcontroller&w2=Microprocessor&w3=Microchip+pic&w4=Microcontrollers&w5=Picmicro&w6=Pic+microcontrollers&c=6&s2&.
> sig=cxg8HXTXLd38eREw0NTdfg]
> Microcontrollers [link: groups.yahoo.
> com/gads?t=ms&k=Microcontrollers&w1=Microcontroller&w2=Microprocessor&w3=Microchip+pic&w4=Microcontrollers&w5=Picmicro

Reply by Leon Heller March 3, 20062006-03-03
----- Original Message -----
From: JCullins
To: p...@yahoogroups.com
Sent: Friday, March 03, 2006 1:18 PM
Subject: Re: [piclist] PIC with 2 ADC module

Most pic chips that have analog will have 5 to 8 analog inputs.
Pic16f818, 819, 872 873, 877. There are are many more
than listed here. 
 Mosf PIC16F series as listed here will be be 10 analog as well.
and yes you can read any one are all one after the other. takes approx 10us
for each read.
Jim
 
I think he wanted two separate ADC modules, not inputs.
 
Leon
--
Leon Heller, G1HSM
l...@bulldoghome.com
http://webspace.webring.com/people/jl/leon_heller/