PDA

View Full Version : Ask For Help



Bakari
- 12th July 2006, 06:34
Dear Memebers,

Just I have starred with PIC microcontrollers and I'd to know how to write on EEPROM of PIC16F877. Also is it Possible to generate sound using PIC16F877 and how ???

Best regards,
Bakari

mister_e
- 12th July 2006, 15:29
in the PBP manual, look for DATA, WRITE, READ statement

For the sound... HPWM, SOUND, FREQOUT

Bakari
- 15th July 2006, 08:53
Dear Memebers,

Thank you for helping me in writing on EEPROM. Regarding the sound, I am sorry because my question wasn't clear. I mean to generate words like Hi, Bye, Good, Bad, Hot ....
In fact I am working on robot and I'd like it to talk. Thanks for your support.

Best regards,

Mohammad

mister_e
- 15th July 2006, 17:58
could be done using an external EEPROM and dumping the WAV files into... but you may also look at some dedicated Chips like ISD4002 or some others like that.

HTH

Bakari
- 16th July 2006, 05:22
Dear Member,

I am really sorry for disturbing you with my questions and I am completely appreciating your help. Final question about this point, could you please give me the steps for dumping the wav. file in EEPROM and replaying it back using PIC16F877 microcontroller. Also, what is a typical memory size for the EEPROM recommended to replay for 2 minutes?

Best regards,

Bakari

mister_e
- 16th July 2006, 09:35
:eek: for two minutes... you'll probably need a Flash Card instead or use few 24LC512 on the same I2C bus. For 2 minutes i would suggest to use any ISD chip as i previously suggest.

Basically you may record the Wav file in your computer with a decent Sampling rate, rename it as .BIN then dump it to your EEPROM. Knowing the file size, you'll know the EEPROM size... :eek:

The wav output is pretty simple, you will read your EEPROM, send it to DAC. It could be as simple as a resistor network and a OP-amp

Now, you can also use the same method but use MP3 format instead and use a MP3 decoder IC like VS1001K

Or if you have some guts, you may try the following
http://www.romanblack.com/picsound.htm

good luck!

Acetronics2
- 16th July 2006, 13:56
Hi,

Here to find an oldie : http://www.speechchips.com/shop/

Yesss ... the SPO 256 !!! Hatari !!!

just REALLY easy to use ... now, may be difficult to find, but worth it !!!

Alain

mister_e
- 16th July 2006, 16:06
Yup that's an oldie... how about finding an old Texas Instrumens ti-99/4a speech module ;)

If it's just human words, there's probably some text-to-speech ICs somehow somewhere over the web... sure it must exist. If my memory is good Winbond do some.. but... DUH! Google!

EDIT: nice link Alain..

Acetronics2
- 16th July 2006, 16:48
Hi, Steve

My HP86 with all its peripherals is still alive ...

Ti doesn't speak HP language !!! No Ti home ...

Still useful at home: Unicom 202SR , HP29 ... and the first HP Scientific calculator !!! ( The model 34 ? )

Winbond = $$$$$$ ...

maybe, if not too much words used, an ISD could be used here ...

Cheers, Alain

PS: I found another juke-box "asm include" program ... straight from HTTTP format !!! converter utility comes with.

Bakari
- 18th July 2006, 06:46
Dear members,

Thanks a lot for your support. In fact I have started with the suggestions of mister_e to use ISD4002 with PIC16F877. In fact, while I am reading about it, I faced a lot of difficulties in the part of programming it and interfacing it with PIC16F877. Therefore, it will be great if you provide me with an illustration about these points and detailed steps for recording and playing saved voice messages.

Best regards,

Bakari

Bakari
- 22nd July 2006, 05:11
Dear Members,

Can any body show me the connection between PIC16F877 and ISD4002. I connected them and nothing is working. I have decided to start the troubleshooting with the connection. My connection was as follow (both have ICs DIP pachaging):

PIC16F877 ISD4002

Pin 18 Pin 28

Pin 23 Pin3

Pin 24 Pin 2

Pin 1 in ISD4002 is connected to ground because I need it always in slave mode. Pin 7 in PIC16F877 is connected to Vcc since I need it always in master mode.

Looking for any help.

Best regards,
Bakari

mister_e
- 22nd July 2006, 21:48
To make things simple, you'll need to use SHIFTIN/SHIFTOUT in PBP. so it doesn't really matter the PIC I/O you use.

A while back i used a PIC16F628, Bellow is the hardware assignement i used.


' I/O Definition
' ===============
'
TRISA = %00110000 ' PORTA Output on :
' PORTA<3:0> : LCD data
' PORTA<7:6> : LCD RS & E bit
'
' PORTA Input on :
' PORTA.4 : "ALT PLAY" Button
' PORTA.5 : "PLAY" button
'
TRISB = %11110001 ' PORTB Output on :
' PORTB.1 : ISD4002 SS pin
' PORTB.2 : ISD4002 SCLK pin
' PORTB.3 : ISD4002 MOSI pin
'
' PORTB Input on :
' PORTB.0 : ISD4002 INT pin
' PORTB.4 : ISD4002 MISO pin
' PORTB.5 : ISD4002 RAC pin
' PORTB.6 : "SETUP" button
' PORTB.7 : "RECORD" button

Later to write to the ISD chip, i used


ss = 0
shiftout MOSI,SCLK,LSBFIRST,[ISDword\16]
ss = 1


to read from


ss=0
shiftin miso,sclk,lsbpre,[isdpointer\16]
ss=1


HTH

Bakari
- 24th July 2006, 07:50
Dear mister_e,

Thanks for your support. Could you please send me your code that used for controlling ISD4002. The one that includes the recording and playing back as well as the interrupt routine and the EOM one.

Waiting for your help, please

Best regards,
Bakari

Bakari
- 24th July 2006, 10:22
Dear Member,

Could you please tell me why you need to connect the interrupt pin from ISD4002 to the microcontroller while you can read the EOM or OVF flag from the MISO register? Also, why are you connecting the RAC pin? I think it’s possible to keep it floating. Finally, is it required to set a frequency for the SCLK pin from the microcontroller or they will communicate by default without setting any clock?

All my questions are based on my understanding. If there is any thing wrong please inform me. I am sorry for disturbing you. Thanks again for your help.

Best regards,
Bakari

mister_e
- 24th July 2006, 16:23
for the code... sorry i can't post this one. It's prop to a customer but i remind to see some example here... do a search and you'll find them

Yes you can skip the INT pin and read the EOM instead, same for RAC.

I used them to make things simple and retrieve the begin and end address of each message.

ISDs chips are close to be great, the only kind of bug if those 4002, is the pop sound at the begining and at the end... wich can be resolved in hardware... one reason of the RAC and INT.

You don't need to bother about the SCLK frequency... it will work. It's a synchronous communication, not like a simple SERIN/SEROUT where the baudrate is important.

Bakari
- 25th July 2006, 06:57
Dear mister_e,

I am sending this email for you to say thanks a lot for your great efforts (no other questions up to now)... Thaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aanks.

Yours,
Bakari

Agent36
- 21st September 2006, 22:42
ISDs chips are close to be great, the only kind of bug if those 4002, is the pop sound at the begining and at the end... wich can be resolved in hardware... one reason of the RAC and INT.

Hi,
I am having problems with the pop sound can you let me know how you resolved it please? I found a data sheet from winbond giving a solution to the pop when recording, but not during the play back.

Thanks
Nick

mister_e
- 22nd September 2006, 00:42
That's a pain, the only way i found was to monitor the address and use a extra mute circuit just before the EOF Interrupt.

Agent36
- 22nd September 2006, 16:42
I was thinking of turning the audio amp off a few milli seconds before the pop,
If I record the output audio of the 4002 back to my laptop I can use audio software to determine the average pop time and power down the lm386 before it happens.

When I saw the bit about RAC and INT I thought you might have a way controlling it via the software.

Regards
Nick