Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

dsPIC30F6014A Speech Recognition

Status
Not open for further replies.

digiad

Newbie level 5
Newbie level 5
Joined
Apr 6, 2014
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
117
Hi everbody,
We are using Microchip's dsPIC30F6014A for speech recognition. I am trying to implement speech recognition without using dsPICDEM evaluation board but making use of microchips' speech recognition library.

Our purpose is to make one of the output pin high whenever we recognized the some certain words that we set before like "yes" or "no". We make use of the example code given in dsPIC30F Speech Recognition Library user manual. We build our own word library which includes words such as "yes", "no". Then we tried to compile the code again in MPLAB IDE.

We get the following error which is related to making one of the output pins high.
speechr.c:20: error: 'LATD' undeclared (first use in this function)
speechr.c:20: error: (Each undeclared identifier is reported only once
speechr.c:20: error: for each function it appears in.)
speechr.c:21: error: 'TRISD' undeclared (first use in this function)
speechr.c:38: error: '_LATD3' undeclared (first use in this function)
speechr.c:39: warning: implicit declaration of function '__delay32'
speechr.c:45: error: '_LATD0' undeclared (first use in this function)

As we mention earlier our main goal is to make one of the output pin of the dspic high, we the desired word is recognized by the processor using speech recognition library.

Could you please help us on that regard? It is very important for us to implement this code.
P.S. We do not have dsPICDEM evaluation board. We have only dsPIC30F6014 processor (with 10MHz Crystal) and si3000 audio codec.

We attached some photos showing our hardware parts and example code.
https://obrazki.elektroda.pl/7780611400_1398380127.jpg
https://obrazki.elektroda.pl/2144382900_1398380128.jpg
https://obrazki.elektroda.pl/2670449100_1398380130.jpg

************** Here are our code:

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//-------------------------------------------------------------
// dsPIC30F Speech Recognition Example Program
//-------------------------------------------------------------
 
//#include <p30f6014A.h>
#include "SR_Lib.h"
#include "robot.h"
//-------------------------------------------------------------
// Initialization Settings
//-------------------------------------------------------------
#define fclock 6144L // clock oscillator frequency
#define pll_setting 8 // PLL multiplier mode
#define timeout 10 // timeout period in seconds
#define mic_gain 30 // microphone gain in dB
#define SR_mode 1 // no self-test, use keyword activation
 
// -------------------------------------------------------------
int main(void)
{
 LATD = 0; 
 TRISD = 0b1111111111110000;
int word;
// Initialize speech recognizr
SR_Initialization(fclock, pll_setting, timeout, mic_gain, SR_mode);
 
// -------------------------------------------------------------
// SR Main Working Cycle
// -------------------------------------------------------------
while (1)
{ 
// recognize words spoken by the user
word = SR_Recognizer();
switch (word) {
case SRL_NONE:
// recognition in process - doesn't require action
break;
case SRL_GO ... SRL_YES:
 _LATD3 = 1;  // whenever recognized the desired word led will light up
 __delay32(15000000);
 _LATD3 = 0;
__delay32(15000000);
// valid word recognized - process it
break;
case SRL_UNKNOWN:
_LATD0 = 1;
 __delay32(1500000);
 _LATD0 = 0;
__delay32(1500000);
default :
// unknown response - doesn't require action
break;
} /* end switch(word) */
} /* end while(1) */
} /* end main() */

 
Last edited by a moderator:

You commented the first line, which probably contains declaration for missed variables:


Code C - [expand]
1
//#include <p30f6014A.h>



+++
 

We know if we open that command we will get rid of above error.However, this time we are getting following error.

SR_Lib.h:81: error: conflicting types for 'WREG0'
c:/program files/microchip/mplab c30/bin/bin/../../support/dsPIC30F/h/p30f6014.h:65: error: previous declaration of 'WREG0' was here
same error is valid also for WREG1 and WREG2

Does any one there who have knowledge on speech recognition library of microchip company? Or already implemented speech recognition library using microchips speech recognition library?
Please help us.
 

i did using DsPIC30F6014A and used crystal 6.144Mhz and used dsPICDEM circuit for the codec part ( connections for Si3000) and worked fine using my own word library

your problem shows that you are using DSPic30F6014A and in code it is Shown as DSPic30F6014
DSPic30F6014 is used in demo code and if you are using DSPic30F6014A you need to change all lines pointing to DSPIC30F6014

and i don't think it will work with 10Mhz crystal since DSPIC30F6014 cannot give required clock to Si3000 with that frequency
 

this is the compiler output

----------------------------------------------------------------------
Release build of project `E:\eagle-proj\SR_Demo\ttt.mcp' started.
Language tool versions: pic30-as.exe v3.31, pic30-gcc.exe v3.31, pic30-ld.exe v3.31, pic30-ar.exe v3.31
Wed Jun 25 15:26:20 2014
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Deleted file "E:\eagle-proj\SR_Demo\roboarm.o".
Clean: Deleted file "E:\eagle-proj\SR_Demo\demolib_ext.o".
Clean: Deleted file "E:\eagle-proj\SR_Demo\demolib_int.o".
Clean: Deleted file "E:\eagle-proj\SR_Demo\demolib_voc.o".
Clean: Deleted file "E:\eagle-proj\SR_Demo\SR_config.o".
Clean: Deleted file "E:\eagle-proj\SR_Demo\SR_utils.o".
Clean: Deleted file "E:\eagle-proj\SR_Demo\ttt.cof".
Clean: Deleted file "E:\eagle-proj\SR_Demo\ttt.hex".
Clean: Deleted file "E:\eagle-proj\SR_Demo\ttt.mcs".
Clean: Done.
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=30F6014A -x c -c "roboarm.c" -o"roboarm.o" -g -Wall
roboarm.c: In function '_U1RXInterrupt':
roboarm.c:54: warning: array subscript has type 'char'
roboarm.c: In function 'delay':
roboarm.c:203: warning: unused variable 'dy'
roboarm.c: In function 'main':
roboarm.c:344: warning: 'return' with no value, in function returning non-void
roboarm.c:549: warning: implicit declaration of function 'atoi'
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=30F6014A -c "demolib_ext.s" -o"demolib_ext.o" -Wa,-g
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=30F6014A -c "demolib_int.s" -o"demolib_int.o" -Wa,-g
demolib_int.s: Assembler messages:
demolib_int.s:61: Warning: Quoted section flags are deprecated, use attributes instead
demolib_int.s:342: Warning: Quoted section flags are deprecated, use attributes instead
demolib_int.s:946: Warning: Quoted section flags are deprecated, use attributes instead
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=30F6014A -c "demolib_voc.s" -o"demolib_voc.o" -Wa,-g
demolib_voc.s: Assembler messages:
demolib_voc.s:32: Warning: Quoted section flags are deprecated, use attributes instead
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=30F6014A -x c -c "SR_config.c" -o"SR_config.o" -g -Wall
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=30F6014A -c "SR_utils.s" -o"SR_utils.o" -Wa,-g
SR_utils.s: Assembler messages:
SR_utils.s:44: Warning: Quoted section flags are deprecated, use attributes instead
SR_utils.s:44: Warning: Implied attributes for section '.nbss' are deprecated
SR_utils.s:47: Warning: Implied attributes for section '.ydata' are deprecated
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=30F6014A "roboarm.o" "demolib_ext.o" "demolib_int.o" "demolib_voc.o" "SR_config.o" "SR_utils.o" "E:\eagle-proj\SR_Demo\SR_Lib.a" -o"ttt.cof" -Wl,--script="C:\Program Files\Microchip\MPLAB C30\support\dsPIC30F\gld\p30F6014A.gld",--defsym=__MPLAB_BUILD=1,-Map="ttt.map",--report-mem


Program Memory [Origin = 0x100, Length = 0x17efe]

section address length (PC units) length (bytes) (dec)
------- ------- ----------------- --------------------
.text 0x100 0x3ba 0x597 (1431)
.keyword 0x4bc 0x2e98 0x45e4 (17892)
.hmm_lib 0x3354 0x1cf0 0x2b68 (11112)
.codebook 0x5044 0x1558 0x2004 (8196)
.text 0x659c 0x1f32 0x2ecb (11979)
.dinit 0x84ce 0x26c 0x3a2 (930)
.cos_table 0x873a 0x120 0x1b0 (432)
.text 0x885a 0x11c 0x1aa (426)
.vocabulary 0x8978 0x28 0x3c (60)
.text 0x89a0 0xe 0x15 (21)

Total program memory used (bytes): 0xccff (52479) 35%


Data Memory [Origin = 0x800, Length = 0x2000]

section address alignment gaps total length (dec)
------- ------- -------------- -------------------
.xbss 0x800 0 0x6c0 (1728)
.xdata 0xec0 0 0x2 (2)
.nbss 0xec2 0 0xee (238)
.ndata 0xfb0 0 0x3a (58)
.nbss 0xfea 0 0x2 (2)
.ybss 0x24c4 0 0x30 (48)
.ydata 0x24f4 0 0x7c (124)
.ydata 0x2570 0 0x290 (656)

Total data memory used (bytes): 0xb28 (2856) 34%


Dynamic Memory Usage

region address maximum length (dec)
------ ------- ---------------------
heap 0 0 (0)
stack 0xfec 0x14d8 (5336)

Maximum dynamic memory (bytes): 0x14d8 (5336)

Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-bin2hex.exe" "E:\eagle-proj\SR_Demo\ttt.cof"
Loaded E:\eagle-proj\SR_Demo\ttt.cof.
----------------------------------------------------------------------
Release build of project `E:\eagle-proj\SR_Demo\ttt.mcp' succeeded.
Language tool versions: pic30-as.exe v3.31, pic30-gcc.exe v3.31, pic30-ld.exe v3.31, pic30-ar.exe v3.31
Wed Jun 25 15:26:26 2014
----------------------------------------------------------------------
BUILD SUCCEEDED
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top