Interfacing / connecting the Emic TTS Speech Module with a PIC16f876A using mba
Hi
·
I am trying to interface a Pic16F876A with a Parallax Emic TTS Module. I am also using mbasic professional version to program the PIC. According to the manual the connections seem relatively simple. However, in all my efforts I think I am missing something. I cannot seem to get the emic to talk or at least mumble a word. I am using the SP+/- with the appropriate rated speaker for sound. Here is a simple program that I wrote to simply test the functionality of the speech module.
·
CPU = 16F876A
MHZ = 4
·
;Constants
;
tx con n2400··· ··········· ··········· ; baud
stopbit con 500
cmd con 0x00············· ··········· ;converter text
vol con 0x01··············· ··········· ; volume
spd con 0x02·············· ··········· ; speed
ptch con 0x03············· ··········· ; pitch
eom con 0xaa·············· ··········· ; end of message
msg bytetable "Hello World"················ ; store message
rst con c6································ ; hard reset pin
·
;Initialization
;
gosub reset······ ······················· ; hard rest emic
·
·
; MAIN
·
main:
serout b0, tx, stopbit, [noparse][[/noparse]cmd, vol, spd, ptch, msg, eom] · ; first test
goto main································ ; keep running the program
···········
reset:
··········· low rst························· ; reset the emic
··········· pauseus 100················ ; wait approx 100us
··········· input rst······················· ; float reset pin
return
·
I have all the basic connections necessary to power the PIC. B0 is connected to the SIN pin of Emic board. I am also using C6 to the /reset pin of the Emic. The other 2 connections that I am using on the Emic board is VCC and GND. The 2 switches on the Emic are in off position.
·
Has anyone else successfully used the emic with any PIC? If so, please post your success or if anyone can help me out by seeing my errors, please let me know. I would really like to get this device working shortly. Thank you in advance to everyone who may decide to add something to this thread. I really appreciate it.
·
·
I am trying to interface a Pic16F876A with a Parallax Emic TTS Module. I am also using mbasic professional version to program the PIC. According to the manual the connections seem relatively simple. However, in all my efforts I think I am missing something. I cannot seem to get the emic to talk or at least mumble a word. I am using the SP+/- with the appropriate rated speaker for sound. Here is a simple program that I wrote to simply test the functionality of the speech module.
·
CPU = 16F876A
MHZ = 4
·
;Constants
;
tx con n2400··· ··········· ··········· ; baud
stopbit con 500
cmd con 0x00············· ··········· ;converter text
vol con 0x01··············· ··········· ; volume
spd con 0x02·············· ··········· ; speed
ptch con 0x03············· ··········· ; pitch
eom con 0xaa·············· ··········· ; end of message
msg bytetable "Hello World"················ ; store message
rst con c6································ ; hard reset pin
·
;Initialization
;
gosub reset······ ······················· ; hard rest emic
·
·
; MAIN
·
main:
serout b0, tx, stopbit, [noparse][[/noparse]cmd, vol, spd, ptch, msg, eom] · ; first test
goto main································ ; keep running the program
···········
reset:
··········· low rst························· ; reset the emic
··········· pauseus 100················ ; wait approx 100us
··········· input rst······················· ; float reset pin
return
·
I have all the basic connections necessary to power the PIC. B0 is connected to the SIN pin of Emic board. I am also using C6 to the /reset pin of the Emic. The other 2 connections that I am using on the Emic board is VCC and GND. The 2 switches on the Emic are in off position.
·
Has anyone else successfully used the emic with any PIC? If so, please post your success or if anyone can help me out by seeing my errors, please let me know. I would really like to get this device working shortly. Thank you in advance to everyone who may decide to add something to this thread. I really appreciate it.
·
Comments
Speaking of the port B and C DDR directive, where are your TRIS directives for setting the B and C port bits as inputs or outputs ?
I use MBASIC876A but I think it's similar to your version for setting the TRISX directives.
You should have something like TRISB=%11111110 ' assuming your only using B0 as an output.
then TRISC=%10111111 ' assumes your using C6 as an output also
If you used B0 for serial out and B1 for reset then you would only need TRISB=%11111100 'B0 and B1 set as outputs
near the top of your code.
Also if you have moved from a stamp to a PIC remember the port directives are opposite of a stamp, a stamp uses 1 to set the DDR as an output pin and 0 to set it as an input while the PIC use 0 to set as an output and 1 to set as an input.
Also if you want to change Volume, Speed and pitch in the future these should be declared as Variables.
Mike
Later
Bill
You need Sin and Sout and Busy @ min...
I have tried all combos and looks like that's the min you need...
You also have to send a Soft or Hard(Pin)·Reset command at boot
or it will not work...You need the Sout to get the Ok from the unit
after reset...
Good Luck...