Since this forum is for PicBasic, here's a simple test routine to check out the EMIC module.
Code:
DEFINE OSC 20
' -----[ I/O Definitions ]---------------------------
Tx VAR PORTC.0 ' wire to EMIC sin pin
Busy VAR PORTC.2 ' wire to EMIC busy pin
Rst VAR PORTC.1 ' wire to EMIC reset pin
' -----[ Constants ]---------------------------------
BAUD CON 0 ' T2400
Yes CON 1
' -----[ Initialization ]----------------------------
TRISC = %000010100
Setup:
GOSUB Hard_Reset ' restore defaults
PAUSE 1000
SEROUT TX, Baud, ["volume=7;"] ' max volume
GOSUB Check_Busy
SEROUT TX, Baud, ["pitch=1;"] ' adjust voice pitch
GOSUB Check_Busy
SEROUT TX, Baud, ["speed=1;"] ' set speech speed
GOSUB Check_Busy
Talk:
SEROUT TX,Baud,["say= I should be using pick basic pro;"]
GOSUB Check_Busy ' wait for busy to release
PAUSE 10000 ' long pause between message
GOTO Talk
' -----[ Subroutines ]---------------------------------
' -- wait until Busy line released by Emic
Check_Busy:
PAUSE 5 ' allow busy time to activate
WHILE Busy = Yes : WEND ' wait until not busy
RETURN
' Hard reset
' -- good when comm link is lost
Hard_Reset: ' reset to default values
LOW Rst ' pull reset line low
PAUSEUS 200 ' 200uS pause
INPUT Rst ' let reset float
RETURN
I've included the .hex file here for you. Wire your 16F876A to the EMIC as shown in the I/O
Definitions section, and program it with the .hex file attached.
If it doesn't work, then you may have a damaged EMIC module, bad speaker, or something
isn't wired properly. If it does work, let me know.
Bookmarks