Y
Yoong Ping, Lim
Guest
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.
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.