• AVR Freaks

Speech recognition using dsPIC33FJ128GP202

Page: 123 > Showing page 1 of 3
Author
SkyX
New Member
  • Total Posts : 21
  • Reward points : 0
  • Joined: 2009/03/13 07:58:46
  • Location: 0
  • Status: offline
2009/03/13 08:20:48 (permalink)
0

Speech recognition using dsPIC33FJ128GP202

Hello, this is the first time I'm using a PIC and doing speech recognition. I've bought a dsPIC33FJ128GP202 and SI3000 voice codec to perform the speech recognition.

I've read the Speech Recognition Library user guide and there are certain parts that I'm unsure of,

1) Is the demo board necessary to do the speech recognition?
2) Is the 6.144Mhz external crystal needed or I could define the speed using the internal oscillator?
3) I've downloaded the sample speech recognition code from Microchip's website....can I modify the program to suit my application? Let's say I would want to output a signal to RB0 by speaking the word "Light" followed by "One".
4) There's a driver code for the SI3000 voice codec. Is it necessary to implement into the program too for the speech recognition to work?

These are the questions I could think of now... I'm sorry if these are already specified in the user guide, I really hope anyone who did the speech recognition using the dspic could guide me around.

Thanks ! Smile
#1

52 Replies Related Threads

    beaker
    Senior Member
    • Total Posts : 139
    • Reward points : 0
    • Joined: 2005/11/02 10:42:03
    • Location: USA
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/14 05:45:32 (permalink)
    0
    I have already done much of what you want to do using the 'GP710 on the 80-pin demo board, though it has been a while. I do not usually help people with only one post, because they are notoriously unresponsive, but if you are sincerely interested in this, I'll do what I can to help. Reply back.
    #2
    SkyX
    New Member
    • Total Posts : 21
    • Reward points : 0
    • Joined: 2009/03/13 07:58:46
    • Location: 0
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/14 08:24:44 (permalink)
    0
    Thanks for the reply ! Smile I hope you are willing to guide me on this speech recognition program.

    So I currently am trying to convert the sample program from the microchip website to use with a dspic33f... could you guide me on what should I look into first?

    And also I really appreciate if you could answer the questions in my first post Smile
    #3
    beaker
    Senior Member
    • Total Posts : 139
    • Reward points : 0
    • Joined: 2005/11/02 10:42:03
    • Location: USA
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/14 17:04:49 (permalink)
    0
    1) Is the demo board necessary to do the speech recognition?

    No. But you will have to create your own development system, as I did.

    2) Is the 6.144Mhz external crystal needed or I could define the speed using the internal oscillator?

    The 6.144 MHz crystal is not needed. The codec's sampling rate and PLL configuration will ultimately drive your clock requirements.

    3) I've downloaded the sample speech recognition code from Microchip's website....can I modify the program to suit my application? Let's say I would want to output a signal to RB0 by speaking the word "Light" followed by "One".

    Yes. You will call library functions then do as you please with the results.

    4) There's a driver code for the SI3000 voice codec. Is it necessary to implement into the program too for the speech recognition to work?

    I think so, but my memory grows dim on this point, and I'll have to do some research. I see that I initialized the device in my program, but I believe their library takes it from there. So once the codec is setup, you don't much need to worry about it. The library functions do that stuff for you.
     
    OK, with your questions answered, the first and foremost thing is to get the hardware development environment established. If you are going to design your own and not use Microchip's development board, you have quite a bit of hardware design and fabrication in front of you before you can even worry about software.
     
    Your decision is entirely up to you, but given that I just went through the process of creating my own similar hardware, I strongly suggest you design a PCB. (I did not.) This type of endeavor involves reasonably high speed mixed signal devices. Failure to design an electrically sound prototype will result in more noise in your audio output.
     
    Let's start from the hardware.
    #4
    SkyX
    New Member
    • Total Posts : 21
    • Reward points : 0
    • Joined: 2009/03/13 07:58:46
    • Location: 0
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/14 18:27:29 (permalink)
    0
    Alright, thanks for clearing up my questions Smile

    So is there any schematics that I could refer to to design a prototype pcb?
    #5
    beaker
    Senior Member
    • Total Posts : 139
    • Reward points : 0
    • Joined: 2005/11/02 10:42:03
    • Location: USA
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/15 05:33:31 (permalink)
    0
    Yes, the schematic on page 12 of the Si3000 datasheet, and the schematic for the dsPICDEM 1.1 development board.
     
    Some things to consider:
    1.  Power. The codec has separate digital and analog power pins. Pay attention to this detail, since this can be a source of noise. Use separate routing paths from your regulator to the respective pins.
    2.  Input/Output. Your application is essentially 'input only', but you will want to provide for audio output, too, so that you may use your ears to evaluate the quality of the audio signal. Decide which complement of I/O options you want. For instance, you may wish to have MIC IN/LINE OUT. Or you might want both MIC and LINE IN where you have an electret microphone on the MIC IN and a high quality, plug-in type microphone for the LINE IN. That way you can do comparisons to see which achieves the best results.
    3.  Oscillator. You may wish to provide for an external, crystal clock source for the MCLK input to the codec. The trouble with those 'can' type oscillators is that they are often 5V devices, and you will be running at 3.3V with the dsPIC33F series. What I do not know is how much noise is contributed to the audio signal as a result of an impure MCLK source. I used an Ouput Compare channel of the processor. Or, you could just purchase the demo board. It already has provisions for one (albeit, for a dsPIC30F series chip).
    4.  Master/Slave mode. The decision of which device will be the master in the bus relationship has hardware implications. I have done both, and I believe that making the codec the master is superior because it makes the software simpler. The drawback is that it requires one more circuit (SCLK is not used in slave mode.)
     
    Must go now
    #6
    SkyX
    New Member
    • Total Posts : 21
    • Reward points : 0
    • Joined: 2009/03/13 07:58:46
    • Location: 0
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/15 11:57:46 (permalink)
    0
    I'll look into the datasheets immediately, will upload my circuit once I've done it Smile

    On a side note...do you think I could complete them in 1 week?
    #7
    beaker
    Senior Member
    • Total Posts : 139
    • Reward points : 0
    • Joined: 2005/11/02 10:42:03
    • Location: USA
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/15 16:54:43 (permalink)
    0
    Yes, one week should be an appropriate timeframe for a schematic.
     
    The Speech Recognition Library (SRL) does setup the codec for Master mode. This saves you a circuit because only four circuits are needed between the codec and the DCI peripheral of the processor. The DCI's Bit Clock Generator (BCG) supplies the Master Clock (MCLK) signal.
     
    Study the dsPICDEM schematic on this point. If I remember correctly (it has been a year-and-a-half), they use jumpers so that the user can setup the codec for either mode of operation. I suggest you emulate this in your design for greatest flexibility in your prototype.
    #8
    SkyX
    New Member
    • Total Posts : 21
    • Reward points : 0
    • Joined: 2009/03/13 07:58:46
    • Location: 0
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/16 08:19:54 (permalink)
    0
    I've done the schematic partially as I'm not sure where should the remaining pins be connected to...

    Here is what I had done so far :

    Attached Image(s)

    #9
    beaker
    Senior Member
    • Total Posts : 139
    • Reward points : 0
    • Joined: 2005/11/02 10:42:03
    • Location: USA
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/16 09:57:56 (permalink)
    0
    Since the DCI is a mappable peripheral, you will have to study the datasheet and decide which mappable pins you want to put the peripheral onto. Since the processor should be the master, three of the DCI circuits will be outputs and one will be an input.

    VDDCORE needs a 1 or 10 uF tantalum cap.
     
    The 'RESET pin (pin 9) on the codec needs to be under software control. Dedicate a GPIO pin to it.
     
    The resistor on pin 2 of the codec looks like a copy-and-paste error. It's value should nominally be 2.2k ohms.
     
    For this application, the processor should have an external crystal oscillator, preferably 7.3728 MHz.
     
    The series capacitors on the speaker outputs should be 10 uF, not 0.1 uF.
    #10
    SkyX
    New Member
    • Total Posts : 21
    • Reward points : 0
    • Joined: 2009/03/13 07:58:46
    • Location: 0
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/16 11:02:12 (permalink)
    0
    Ah, that clears some things up about the DCI...I was wondering which pin is used for DCI purpose grin so I guess the DCI pins would be connected to the SCLK, FSYNC, SDI, SDO, and the MCLK to a GPIO pin ?

    I forgot to mention that I don't really understand on how the jumper works to set the SI3000 as Master or Slave, that's why I didn't connect them yet.
    How would it be like if I just wanted the codec be in Master or Slave mode?

    Thanks for correcting the error about the resistor too Smile





    #11
    beaker
    Senior Member
    • Total Posts : 139
    • Reward points : 0
    • Joined: 2005/11/02 10:42:03
    • Location: USA
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/16 17:29:33 (permalink)
    0
    Close, but not quite. I encourage you to make a little table listing the six pins on the codec that must connect to the processor for both master and slave modes, like so:

                  Processor pins:
    Codec pin     Master     Slave
    MCLK
    SCLK
    SDO
    SDI
    FSYNC
    RESET

    Under the 'Master' and 'Slave' columns, list the remappable DCI pins and the GPIO pins you would use to establish each mode of operation.
    #12
    SkyX
    New Member
    • Total Posts : 21
    • Reward points : 0
    • Joined: 2009/03/13 07:58:46
    • Location: 0
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/18 06:10:22 (permalink)
    0
    I'm sorry that there's some delay in my updates, anyways I've completed the mapping of the pins finally Smile

    However I'm not sure on how are the pull-ups or pull-downs resistors are used, namely on the SCLK and SDO pins of the codec...are my connections correct?

    Besides that, the MCLR pin on the DSPIC can be left like that right?

    I think I'll resort to using the codec as slave only for now... I hope that it won't add much complexity to the programming.

    Thanks again for your guide and help ! I doubt I could progress that much without any guidance from you Smile
    post edited by SkyX - 2009/03/18 06:34:16

    Attached Image(s)

    #13
    beaker
    Senior Member
    • Total Posts : 139
    • Reward points : 0
    • Joined: 2005/11/02 10:42:03
    • Location: USA
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/18 12:20:36 (permalink)
    0
    I think I'll resort to using the codec as slave only for now...

    Since the Speech Recognition Library (SRL) configures the codec for you, the additional software complexity inherent therein is done for you, so this is a perfectly acceptable decision. So instead of making your design multi-purpose, we'll just confine ourselves to the specific task at hand. Good enough.
     
    ...the MCLR pin on the DSPIC can be left like that right?

    Your MCLR circuit is fine. The 'RESET circuit on the codec is OK, too, but keep in mind, if you reset the codec with a pushbutton, it will lose whatever configuration the processor gave to it at startup. Then, to get the application working again, the processor will have to reconfigure it. For this reason, I put my pushbutton reset onto the processor, not the codec. When the processor resets, it resets the codec.
     
    You could, of course, remove the pushbutton and the pullup resistor entirely, and command the GPIO pin on the processor to reset the codec. Under that scenario, some mechanism would need to exist to command the processor to do so. A serial port, for example, might be useful for such an arrangement.
     
    However I'm not sure on how are the pull-ups or pull-downs resistors are used, namely on the SCLK and SDO pins of the codec...

    For the uninitiated, what you are referring to here is the use of SDO and SCLK to put the codec into either master or slave mode. What I did for this was to write a special function to reset the codec prior to enabling the DCI peripheral. Hence, I used the DCI pins as GPIO to establish the operational mode, then I enabled the DCI peripheral to take over the operation of those pins. It saves external hardware. So don't worry about it. You will do it in software.
    #14
    SkyX
    New Member
    • Total Posts : 21
    • Reward points : 0
    • Joined: 2009/03/13 07:58:46
    • Location: 0
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/19 04:45:25 (permalink)
    0

    What I did for this was to write a special function to reset the codec prior to enabling the DCI peripheral. Hence, I used the DCI pins as GPIO to establish the operational mode ...


    I had removed the pull-up / pull-down resistors at SDO/SCLK, and also assigned a programmable pin to SDO if that's what you meant. I've also removed the pushbutton and resistor at RESET as you suggested Smile.


    So I think this would be my final schematic revision hopefully grin, and I could get started immediately in doing the PCB.
    post edited by SkyX - 2009/03/24 10:26:23

    Attached Image(s)

    #15
    beaker
    Senior Member
    • Total Posts : 139
    • Reward points : 0
    • Joined: 2005/11/02 10:42:03
    • Location: USA
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/19 05:53:00 (permalink)
    0
    Schematic is looking good. I like the use of separate regulators for VDD and AVDD. More parts, but a better design.
     
    One thing I thought about is whether you want to include a serial port. I mention this because the Si3000 includes a lot of settable parameters. It is nice to be able to use a computer to command the processor to change the settings inside the codec. Mind you, it adds a bunch more work to the project, and may not be worth it. If you don't add a serial port, then you must recompile and download each time you wish to change a setting within the codec.
     
    What I was getting at about SDO and SCLK is that these two pins will initially be configured as RB13 and RB10, respectively, or in other words, GPIO, at startup. You will then exercise manual control over them as GPIO pins to place the codec into its operational mode. Once that task is complete, you will assign the appropriate DCI functions to these remappable pins and then enable the DCI module. Upon doing so, these pins will cease to be GPIO pins and will become DCI peripheral pins.
    #16
    SkyX
    New Member
    • Total Posts : 21
    • Reward points : 0
    • Joined: 2009/03/13 07:58:46
    • Location: 0
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/19 06:26:53 (permalink)
    0

    One thing I thought about is whether you want to include a serial port. I mention this because the Si3000 includes a lot of ...


    I guess I'll stick to the recompile and download method to keep things as simple as possible for my first project grin.

    Alright then, time for designing the PCB layout. Smile
    #17
    SkyX
    New Member
    • Total Posts : 21
    • Reward points : 0
    • Joined: 2009/03/13 07:58:46
    • Location: 0
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/21 02:41:07 (permalink)
    0
    I think I could get started on doing the programming part now .. so where should I start looking at regarding about modifying the sample code to suit my application?
    #18
    beaker
    Senior Member
    • Total Posts : 139
    • Reward points : 0
    • Joined: 2005/11/02 10:42:03
    • Location: USA
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/21 05:54:44 (permalink)
    0
    With no sense of flippancy or dismissiveness intended, you should start by reading the manual for the Speech Recognition Library.
     
    Once you have done so, setup your MPLAB environment to work with the intended target (a dsPIC30F6014A, if I remember correctly), just to get over the hurdles of getting the project established correctly. Once you can compile, it will be easier to modify things for the 33F family.
     
    At that point, I'll jump back in and tell you the secret little things you must add to source code to override the hardcoded behavior in their library file for the '6014A processor.
     
    I also strongly suggest performing a 'sanity check' project wherein you simply loopback the audio to the Si3000 to make sure it is working properly. I can help with that, too.
    #19
    MikeMayfield
    Starting Member
    • Total Posts : 32
    • Reward points : 0
    • Joined: 2009/03/20 21:12:04
    • Location: 0
    • Status: offline
    RE: Speech recognition using dsPIC33FJ128GP202 2009/03/21 09:35:17 (permalink)
    0
    Not to detract from this discussion, but I was wondering what program you are using to create your schematics. I use Visio and I don't really like it.
    #20
    Page: 123 > Showing page 1 of 3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5