Maker Pro
Maker Pro

advise on doing voice transmission using pic 16f876, URGENT....!!!!

Y

Yoong Ping, Lim

Jan 1, 1970
0
Hi there,

I am doing a project on 16f876s addressing the above mentioned. The
objective is to use one 16f876 to adc the voice from a mic and then transmit
in to the other end 's pic using rs232.

I am struck at obtaining intelligentable voice and has the below
observations that has made been worrying me if I am placing on the wrong
directions.

I am currently using a relatively high level c compiler , wiz c,
professional edition. It is very high level in the sense in which lots of
libraries are already given.
the compiler is a one man show, which i am starting to doubt its capability.
I am using a 20Mhz clock.

1. when i tried a

while(1){
led=0;
}

void on_timer_overflow(){
reset the timer to a value;
led=1;
}

i see the time taken for a period of short blast of 1 and then 0 is about
56us. is it too short? Which relates to about 17khZ. which is very slow
right?

2. assuming that i have very reliable transmission rate of 19200bps. and
rs232 has 1 start and 1 stop, each frame is 10 bits.
each frame is 520us.

3. nyqust states 2*bw. voice of 4k thus sampling of 8k is required. (bare
min)
each require sample time is 125us.


HENCE,

PROBLEM 1

i can see a contradiction between pt 2 and 3. with 8 bits and that i use a
typical voice coding dpm, i at least 2 bits for each sample. (is it
enough)???? i can only pack 4 sample in each 520us instead of 5. not to
mention that it is the bare min sampling. and if i do companding i dun even
know if it helps..



please advise. or get me a new direction? i tried to find some codec chips
but as i am in melb. i can only find the etc5057. oki semiconductor.
it is very complex and it has get me thinking if i should change my
direction.

PROBLEM 2

IN addition, as i mentioned that due to 1. the loop time is 56us. we need 1
sample per 125us. how can we find time to do transmission using rs232 -
requiers 520us.


i realise that i can either go into assembly or change a compiler( i am
running out of time , i presume)
or use a codec chip? i cant find one that is easy to use.

i can too use real time programming BUT due to the inherent slow speed, i
dun think i can. (leading slow context switching)

I presumed that the best way out is to use a codec chip which is able do
data transmission.
 
P

Phil Allison

Jan 1, 1970
0
"Yoong Ping, Lim"
I am doing a project on 16f876s addressing the above mentioned. The
objective is to use one 16f876 to adc the voice from a mic and then transmit
in to the other end 's pic using rs232.


** Try entering " infinitely clipped speech " into Google.

Pre processing the audio this way will reduce the data rate drastically.

Here is an example of how to do it.

http://members.tripod.com/werdav/sspeech.html





............ Phil
 
Y

Yoong Ping, Lim

Jan 1, 1970
0
another question.

if i am using the 16f876 which only has one 1 rs232 hardware port.

but i need two uart port, can you pls guide me on how to create another?

thanks .
 
D

Don McKenzie

Jan 1, 1970
0
Hi there,

I am doing a project on 16f876s addressing the above mentioned. The
objective is to use one 16f876 to adc the voice from a mic and then transmit
in to the other end 's pic using rs232.

I am struck at obtaining intelligentable voice and has the below
observations that has made been worrying me if I am placing on the wrong
directions.

I am currently using a relatively high level c compiler , wiz c,
professional edition. It is very high level in the sense in which lots of
libraries are already given.
the compiler is a one man show, which i am starting to doubt its capability.
I am using a 20Mhz clock.

why not ask on the help group that has been set up for it?

details at:
http://www.dontronics.com/chat.html
Cheers Don...


--
Don McKenzie
E-Mail Contact Page: http://www.e-dotcom.com/ecp.php?un=Dontronics

USB to RS232 Converter that works http://www.dontronics.com/usb_232.html
Don's Free Guide To Spam Reduction http://www.e-dotcom.com/spam_exp.php
 
U

Unbeliever

Jan 1, 1970
0
Yoong Ping said:
Hi there,

I am doing a project on 16f876s addressing the above mentioned. The
objective is to use one 16f876 to adc the voice from a mic and then transmit
in to the other end 's pic using rs232.

I am struck at obtaining intelligentable voice and has the below
observations that has made been worrying me if I am placing on the wrong
directions.

I am currently using a relatively high level c compiler , wiz c,
professional edition. It is very high level in the sense in which lots of
libraries are already given.
the compiler is a one man show, which i am starting to doubt its capability.
I am using a 20Mhz clock.

1. when i tried a

while(1){
led=0;
}

void on_timer_overflow(){
reset the timer to a value;
led=1;
}

i see the time taken for a period of short blast of 1 and then 0 is about
56us. is it too short? Which relates to about 17khZ. which is very slow
right?

2. assuming that i have very reliable transmission rate of 19200bps. and
rs232 has 1 start and 1 stop, each frame is 10 bits.
each frame is 520us.

3. nyqust states 2*bw. voice of 4k thus sampling of 8k is required. (bare
min)
each require sample time is 125us.


HENCE,

PROBLEM 1

i can see a contradiction between pt 2 and 3. with 8 bits and that i use a
typical voice coding dpm, i at least 2 bits for each sample. (is it
enough)???? i can only pack 4 sample in each 520us instead of 5. not to
mention that it is the bare min sampling. and if i do companding i dun even
know if it helps..



please advise. or get me a new direction? i tried to find some codec chips
but as i am in melb. i can only find the etc5057. oki semiconductor.
it is very complex and it has get me thinking if i should change my
direction.

PROBLEM 2

IN addition, as i mentioned that due to 1. the loop time is 56us. we need 1
sample per 125us. how can we find time to do transmission using rs232 -
requiers 520us.


i realise that i can either go into assembly or change a compiler( i am
running out of time , i presume)
or use a codec chip? i cant find one that is easy to use.

i can too use real time programming BUT due to the inherent slow speed, i
dun think i can. (leading slow context switching)

I presumed that the best way out is to use a codec chip which is able do
data transmission.
The PIC 16F876 can run at up to 312.5 kbaud from a 20MHz clock, just pick a
faster baud rate to get the data through, simple.
A second serial port can be implemented in software (bit banged). There are
examples for various PICs on the microchip website.

All that being said, asking a student to use a PIC in this sort of
application must be the academic equivalent of the old army punishment of
cleaning the dunny with a toothbrush, just pure sadism. It can be done, but
for a couple of dollars more a flash DSP or at least a general purpose
processor with a reasonable architecture (like the MSP430, AVR or any ARM)
would be my choice.

Cheers,
Alf
 
Y

Yoong Ping, Lim

Jan 1, 1970
0
=)

Perhaps, that is why no demonstration prototype has been built by the
lecturers to "convince" us.

Btw, what do you mean by bit bang?

I am using a 20Mhz, i suppose it is due to the inefficiency of the compiler
that I was instructed to use.



Thanks.
 
Y

Yoong Ping, Lim

Jan 1, 1970
0
Don, can you please advise me what is the help group ?
 
U

Unbeliever

Jan 1, 1970
0
Btw, what do you mean by bit bang?
Basically using software to output the serial character one bit at a time
out through a port pin, timing the output to the required baud rate.

From http://www.hyperdictionary.com/computing/bit+bang

Definition: Transmission of data on a serial line accomplished by
rapidly changing a single output bit, in software, at the appropriate times.
The technique is a simple loop with eight OUT and SHIFT instruction pairs
for each byte. Input is more interesting. And full-duplex (doing input and
output at the same time) is one way to separate the real hackers from the
wannabees.





Cheers,
Alf
 
O

onestone

Jan 1, 1970
0
Contact me privately and I'll send you some code.

Al
 
Top