Searching \ for '[PIC]: Questions regarding the PIC16C77X and its b' 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/devices.htm?key=16C
Search entire site for: 'Questions regarding the PIC16C77X and its b'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Questions regarding the PIC16C77X and its b'
2002\09\23@152818 by Nathan

flavicon
face
Hello,

I have a few questions in regards to ADC capable PICs (in regards to
the project mentioned below). Unfortunately, my knowledge is lacking
although I am trying to correct that), so bare with me.

I am wanting to sample input from a telephone, encode that input into
mu-law audio format, and then send that data over a LAN to another
machine. I found a company that sells boards that use the CS8900
ethernet chips (preassembled and kits), as well as a tutorial on how
to send UDP packets over an ethernet link using it. Right now however,
I am more concerned with sampling the signal from the telephone, and
to make sure my basic design for that is correct.

Since human speech usually is below 4000 hz, the minimum sample rate I
would need is 8,000 samples per second. Since the signal itself's
highest frequency should be around 4000 hz, a 12 bit resolution (4096
possible values) should work. Is this correct?

I have been looking at the PIC16C77X MCUs.. I was also looking at the
PDF datasheet at:

http://www.microchip.com/download/lit/pline/picmicro/families/16c77x/30275a.pdf

So here are some more somewhat basic questions:

The pinout diagram shows pins 11 as AVdd, pin 12 as AVss, pin 4 as
VRef- and pin 5 as VRef+. These are all of the pins I will
need to use specifically for the ADC part of things, correct? I wish to
have a telephone connected via a standard telephone cord to an RJ11 jack
on a standalone unit (with among other things the PIC in it). A 9V power
supply will be used to power the phone line. Since 9v is way too much to
connect to the AD on the PIC (correct?), a resistor will need to be used
to get it below the 4.096V level (which is the max voltage level for
AVDD,AVSS right?).

So, basically I was thinking the negative terminal on the battery can
be connected to the RING pin on the RJ11 jack, and the TIP pin on the
jack can be connected to the Avdd pin on the PIC, and have the AVss
pin connected to the positive terminal on the battery... I would need
a resistor inbetween the RJ11 TIP pin and the AVDD pin (correct?)..

I have the bad feeling that I have something (lots of things?)
backward however (hence the reason for this post).. I also don't know
what to use for VREF + or VREF -... In the datasheet it mentions "The
analog reference voltages are software selectable to either the
device's analog positive and negative supply voltages (AVDD/AVSS),
the voltage level on the VREF+ and VREF- pins, or the internal
voltage reference if available (VRH, VRL)." Does this mean that only
the AVDD, and AVSS pins are necessary, and VREF+ and - are not needed,
assuming I set the reference voltage to the analog positive and negative
supply?

If someone would care to point out the mistakes I made above, point me
in the right direction etc.. that would be great!

Nathan

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2002\09\23@162922 by hard Prosser

flavicon
face
8Kbit/s sec sampling will be fine. An 8 bit (256 level) ADC will also be
fine for telephone quality - it's what the phone companies use after all!
You don't need 12 bits and 10 bits is probably more resolution than
justified.

For degraded speech quality I think you can drop to ~6 bit resolution and
~6k sampling but it sounds pretty rough!

I'll leave the exact  ADC connections to someone else but you need to use a
5V regulator to drop the 9V supply to 5V for the ADC;  a resistor will not
be sufficient.

The phone line will also need to  be isolated from the "outside world". If
the kit is in a plastic box along with the battery, you may be able to get
away with it (at least for private use !) but for any external connection
(eg the ethernet link) or sellable product  you will need to provide an
isolation barrier (and some sort of compiance/approval) depending on your
market.

Don't forget the 100Vac or so you get back down the line when the phone
rings - you will need to provide protection for this also!

Richard P




Hello,

I have a few questions in regards to ADC capable PICs (in regards to
the project mentioned below). Unfortunately, my knowledge is lacking
although I am trying to correct that), so bare with me.

I am wanting to sample input from a telephone, encode that input into
mu-law audio format, and then send that data over a LAN to another
machine. I found a company that sells boards that use the CS8900
ethernet chips (preassembled and kits), as well as a tutorial on how
to send UDP packets over an ethernet link using it. Right now however,
I am more concerned with sampling the signal from the telephone, and
to make sure my basic design for that is correct.

Since human speech usually is below 4000 hz, the minimum sample rate I
would need is 8,000 samples per second. Since the signal itself's
highest frequency should be around 4000 hz, a 12 bit resolution (4096
possible values) should work. Is this correct?

I have been looking at the PIC16C77X MCUs.. I was also looking at the
PDF datasheet at:

http://www.microchip.com/download/lit/pline/picmicro/families/16c77x/30275a.pdf


So here are some more somewhat basic questions:

The pinout diagram shows pins 11 as AVdd, pin 12 as AVss, pin 4 as
VRef- and pin 5 as VRef+. These are all of the pins I will
need to use specifically for the ADC part of things, correct? I wish to
have a telephone connected via a standard telephone cord to an RJ11 jack
on a standalone unit (with among other things the PIC in it). A 9V power
supply will be used to power the phone line. Since 9v is way too much to
connect to the AD on the PIC (correct?), a resistor will need to be used
to get it below the 4.096V level (which is the max voltage level for
AVDD,AVSS right?).

So, basically I was thinking the negative terminal on the battery can
be connected to the RING pin on the RJ11 jack, and the TIP pin on the
jack can be connected to the Avdd pin on the PIC, and have the AVss
pin connected to the positive terminal on the battery... I would need
a resistor inbetween the RJ11 TIP pin and the AVDD pin (correct?)..

I have the bad feeling that I have something (lots of things?)
backward however (hence the reason for this post).. I also don't know
what to use for VREF + or VREF -... In the datasheet it mentions "The
analog reference voltages are software selectable to either the
device's analog positive and negative supply voltages (AVDD/AVSS),
the voltage level on the VREF+ and VREF- pins, or the internal
voltage reference if available (VRH, VRL)." Does this mean that only
the AVDD, and AVSS pins are necessary, and VREF+ and - are not needed,
assuming I set the reference voltage to the analog positive and negative
supply?

If someone would care to point out the mistakes I made above, point me
in the right direction etc.. that would be great!

Nathan

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamKILLspammitvma.mit.edu


2002\09\23@165720 by Bob Blick

face picon face
On Mon, 23 Sep 2002, Nathan wrote:
>
> I am wanting to sample input from a telephone, encode that input into
> mu-law audio format, and then send that data over a LAN to another
> machine. I found a company that sells boards that use the CS8900
> ethernet chips (preassembled and kits), as well as a tutorial on how
> to send UDP packets over an ethernet link using it. Right now however,
> I am more concerned with sampling the signal from the telephone, and
> to make sure my basic design for that is correct.

As I recall mu-law is 8 bit coding of 12 bit dynamic range. So if you wish
to provide full dynamic range you should convert at 12 bits and have a
lookdown table. If full dynamic range is important to you. Personally I'd
probably use a 10 bit PIC since I have them already.

>
> Since human speech usually is below 4000 hz, the minimum sample rate I
> would need is 8,000 samples per second. Since the signal itself's
> highest frequency should be around 4000 hz, a 12 bit resolution (4096
> possible values) should work. Is this correct?

First part yes, second part no. The lowest sample rate for 4000 Hz is 8000
samples per second. It has nothing to do with resolution of the converter.

> I have been looking at the PIC16C77X MCUs.. I was also looking at the

How about the 18F252 or 18F452? Cheaper and better.

{Quote hidden}

Interfacing to the telephone line requires a bit more understanding of
telephone lines in general. First off, it's balanced line audio. You are
familiar with unbalanced lines.

Secondly, if it is telephone lines outside of the central office, it has
DC on it as well. So you need to block the DC.

You can probably get away with a less-than-perfect interface with the
phone line to prove your concept. Just don't hook an oscilloscope or any
other grounded piece of equipment to the phone line in a way that grounds
either tip or ring.

> what to use for VREF + or VREF -... In the datasheet it mentions "The
> analog reference voltages are software selectable to either the
> device's analog positive and negative supply voltages (AVDD/AVSS),
> the voltage level on the VREF+ and VREF- pins, or the internal
> voltage reference if available (VRH, VRL)." Does this mean that only
> the AVDD, and AVSS pins are necessary, and VREF+ and - are not needed,
> assuming I set the reference voltage to the analog positive and negative
> supply?

Yes, that's what you'd want to do. Amplify the audio so it has 2.5 volts
of DC on it and enough signal to go rail to rail at maximum level.

Keep asking questions!

Cheerful regards,

Bob

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu


2002\09\23@182339 by Olin Lathrop

face picon face
> so bare with me.

Um, that could get me arrested, at least if we do it in public.

> Since human speech usually is below 4000 hz, the minimum sample rate I
> would need is 8,000 samples per second. Since the signal itself's
> highest frequency should be around 4000 hz, a 12 bit resolution (4096
> possible values) should work. Is this correct?

The signal frequency has nothing to do with the A/D resolution.  Yes, you
need to sample at 8KHz minimum.  And this assumes a very sharp external
filter that cuts off at 4KHz.  It may be easier to sample a bit faster, like
16KHz for example, then do software low pass filtering to get the 8KHz
samples.

In either case, you don't need 12 bit resolution if you just want to get
voice from here to there.  Voice will be quite understandable at 10 bit
resolution.

> I have been looking at the PIC16C77X MCUs.. I was also looking at the
> PDF datasheet at:

I would stay away from those PICs.  They useful when you really need 12 bit
A/D resolution and therefore have to put up with all the other stuff to get
it.  10 bit A/D is a lot easier and gives you a much wider choice of PICs.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUTspamTakeThisOuTmitvma.mit.edu


2002\09\23@190829 by Nathan

flavicon
face
On Mon, 23 Sep 2002, Olin Lathrop wrote:

> > so bare with me.
>
> Um, that could get me arrested, at least if we do it in public.
>
> > Since human speech usually is below 4000 hz, the minimum sample rate I
> > would need is 8,000 samples per second. Since the signal itself's
> > highest frequency should be around 4000 hz, a 12 bit resolution (4096
> > possible values) should work. Is this correct?
>
> The signal frequency has nothing to do with the A/D resolution.  Yes, you
> need to sample at 8KHz minimum.  And this assumes a very sharp external
> filter that cuts off at 4KHz.  It may be easier to sample a bit faster, like
> 16KHz for example, then do software low pass filtering to get the 8KHz
> samples.
>
> In either case, you don't need 12 bit resolution if you just want to get
> voice from here to there.  Voice will be quite understandable at 10 bit
> resolution.

I probably should have phrased that better.. That was actually 2
separate questions.. One was to confirm that the the sample rate of 8,000
samples per second (which is the Nyquist rate for a 4,000 hertz signal) is
sufficient, and the other is if a 12 bit resolution is needed to
accurately reproduce the signal for 'telephone quality' audio. I don't know
how much the difference in the quantization error rate for 12 or 10 bit
resolution sample vs. 8 bit resolution sample would affect the audio
quality (given that its human speech). As I understand it most telephone
calls are eventually converted into mu-law format.. Also, as I
understand it, and as Bob Blick pointed out in an earlier response,
mu-law encoding takes a sample with a 12 bit resolution, and produces 8
bit code.. If the difference in the way a 10 bit sample vs. a 12
bit sample encoded in mu-law format sound is negligible, then I would much
prefer to take the 10 bit resolution route. Mainly I was just wanting a
sanity check on that portion of things.

I was mainly concerned with the part of my post that describes how I
understand things would be connected to the PIC, as that is the area I am
most 'fuzzy' on.

Feel free to bat me over the head with a clue bat if any of that doesn't
make sense, or I am wrong, etc.. I'm still very new to this field, and am
trying to learn :)

Nathan

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamspam_OUTmitvma.mit.edu


2002\09\24@023842 by cdb
flavicon
face
It might be worthwhile joining the RATRING group at Yahoo.

This is run by Ken Boakes and ex- BT phone engineer and the whole
group specialises in PIC s and interfacing them to the telephone
lines.

I don't recall what your attempting appearing as a topic on the list
but you might find a like minded person there. Plus how to isolate
your equipment (line transformers) from the phone line, gyrators and
other such things.

There is a web page but I can never remember it's URL.

Colin
--
cdb, @spam@bodgy1KILLspamspamoptusnet.com.au on 24/09/2002

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\09\24@050921 by Nate Duehr

face
flavicon
face
On Tue, 2002-09-24 at 10:38, cdb wrote:
> It might be worthwhile joining the RATRING group at Yahoo.

<snip>

> There is a web page but I can never remember it's URL.

http://groups.yahoo.com/group/rat_ring/

Nate, KILLspamnateKILLspamspamnatetech.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\09\24@074008 by cdb

flavicon
face
Ah yes thanks for that.

I should have made myself clearer. I'm a member of the list, but
there is a webpage by Ken Boakes that has all his PIC/phone creations
on it plus code and explanations, of electronics and the phone
system.

colin
--
cdb, RemoveMEbodgy1TakeThisOuTspamoptusnet.com.au on 24/09/2002

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


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