PDA

View Full Version : PIC16F876 + QV306m4 Problems



pcaccia
- 26th May 2005, 20:01
Hi All.
I'm Paolo from Italy ...a new member! I read threads on this great forum and I think I learn very much, but I'm a novice ... and the solution of some problems aren't write in manuals and datasheets but only with much esperience.
I'm sorry for my bad english but I hope you can understand my problem:
What the software must do:
I read serially a signal from a wether station
Some values are stored and when I press one button, I send serially commands to control a quadravox QV306m4 sound module to speach all values.
The problem is great and only one! When I push the button the QV306m4 sound well only some world or number...and not all.
I can say:
1 The qv306m4 works ok (tested with my PC directly)
2 The software of the peek read perfectly the input serial port
3 The output code to control the qv306m4 aren't totally correct...as I can ear in the speacker of the qv306m4 but the software seem to be ok..HI
In the attachment you can see my terrible software..plase don't kill me ..it's my first software on pic.

I think the problem is in my software for the compatibility with a PIC ...too much gosubs routines, or too much var word or con...I don't know!
Thanks for reading and help
Paolo

Darrel Taylor
- 26th May 2005, 20:55
Hi pcaccia,

With SEROUT2 you can't use the t2400 type constants for the Mode value. They can only be used with SEROUT.

For True 2400 use a mode value of 396.

SEROUT2 QV_RX,396,[frase]

HTH,
   Darrel

P.S. For a complete list of SEROUT2 modes, see this page at melabs
http://www.melabs.com/resources/ser2modes.htm

mister_e
- 26th May 2005, 21:21
t2400 con 396 ' Velocità della seriale 2440/8/n/1 con Max 232

Darrel are you saying that we can't define our own variable with serout2 ?

Darrel Taylor
- 26th May 2005, 21:31
No, of course you can.

He had t2400 listed in 2 different places in the program, one commented one not. I didn't see the second one.

My error.

Darrel

mister_e
- 26th May 2005, 21:51
mmm i think i've found the problem. You said that some are ok, some not... what about if you change your message constants to


_zero con 0
_uno con 1
_due con 2
_tre con 3
_quattro con 4
_cinque con 5
_sei con 6
_sette con 7
_otto con 8
_nove con 9
_dieci con $10
_undici con $11
_dodici con $12
_tredici con $13
_quattordici con $14
_quindici con $15
_sedici con $16
_diciassette con $17

and so on for the others.. just add an $ befor your number. Post your results after that.

Darrel Taylor
- 27th May 2005, 00:29
Let's try this again.

According to the datasheet for the qv306m4.

To select one of the fixed phrases, issue a set mode command for “direct” (0f0h), then send the number of the phrase to be played. I see that you've defined a constant for the command

QV_Direct con $F0 '240 dec

but it doesn't get sent prior to sending the phrases.

Darrel

pcaccia
- 27th May 2005, 17:57
OK today I test my software with a ICD debugger.
The software work perfectly.
All value sent are exactly...but the qv306m4 doesn't work perfectly.
In some case when I send the address 011 he speack the correct word (eleven) with others address he speack wrong word..(but the address number is correct!)
I add the direct command $f0, but the problem is the same.
In the qv306m4 datasheet manual I read it's possible to create a string of max 32 characters and speack all in the same time...I will try this...
All new ideas will be accepted!
I will try also to reprogram the qv306m4...
In the next reply I send you the result.
Thanks

pcaccia
- 28th May 2005, 19:17
Now all work perfectly!
The software it's ok ...the problem was only the qv306m4....I program the QV306m4 another way, and all work without problem.
Thanks
Paolo