Page 1 of 1

uart/speak up board

Posted: 11 Feb 2015 08:15
by cfloryiv
I'm not sure I'm using the uart code correctly in my program. The data ready function is not returning a 1. Is the uart setup right?

/*
* Project name:
LED_Blinking (Simple 'Hello World' project)
* Copyright:
(c) Mikroelektronika, 2011.
* Revision History:
20110929:
- initial release (FJ);
* Description:
This is a simple 'Hello World' project. It turns on/off LEDs connected to
PORTA, PORTB, PORTC, PORTD and PORTE.
* Test configuration:
MCU: PIC18F45K22
http://ww1.microchip.com/downloads/en/D ... 41412D.pdf
Dev.Board: EasyPIC7 - ac:LEDs
http://www.mikroe.com/easypic/
Oscillator: HS-PLL 32.0000 MHz, 8.0000 MHz Crystal
Ext. Modules: None.
SW: mikroC PRO for PIC
http://www.mikroe.com/mikroc/pic/
* NOTES:
- Turn ON the PORT LEDs at SW3.
*/

void main() {
int times=0;
int ii;
char receive;
TRISA = 0; // set direction to be output

UART1_Init(9600);

while(1) {
if (UART1_Data_Ready()) {
receive = UART1_Read();
} else continue;
switch (receive) {
case '1':
times=1; break;
case '2':
times=2; break;
case '3':
times=3; break;
default:
times=0; break;
}
for (ii=0; ii<times; ii++) {
LATA = 0x00; // Turn OFF LEDs on PORTA

Delay_ms(1000); // 1 second delay

LATA = 0xFF; // Turn ON LEDs on PORTA

Delay_ms(1000); // 1 second delay
}
}
}

Re: uart/speak up board

Posted: 11 Feb 2015 12:56
by marina.petrovic
Hi,

Please, can you explain me a little bit more where the problem occurs?
How you test your project/code?

UARTx_Data_Ready() function tests if data in receive buffer is ready for reading and return 1 if data is ready for reading,
which means that if you send some character over UART, UARTx_Data_Ready() will be set to 1,
when is detected that you have some data in receive buffer (character which you send).

Best regards,
Marina

Re: uart/speak up board

Posted: 13 Feb 2015 00:56
by cfloryiv
Thanks for you're response. I've hooked up a speech board to a pic clicker board. I've programmed the speakup board with three entries which return a 1, 2 or 3. However, the speech board is not sending data when I talk to the board. Should it?

Re: uart/speak up board

Posted: 13 Feb 2015 11:31
by marina.petrovic
Hi,

SpeakUp click should send a index of the recognized word over UART if you use the SpeakUp click in "click" mode
(if you connected UART lines from mikroBUS socket).
To see in which format SpeakUp return recognized word, you can simple connect SpeakUp click over some USB UART board with the PC and watch received data in USART Terminal.

Best regards,
Marina

Re: uart/speak up board

Posted: 18 Feb 2015 09:49
by cfloryiv
How do you setup "click" mode. I dont see any reference to this in the software. Also, do you setup communication as uart or usb?

Re: uart/speak up board

Posted: 18 Feb 2015 17:51
by marina.petrovic
Hi,

SpeakUp application can be used with SpeakUp click only in stand-alone mode.
Click mode means that you connect SpeakUp click with your hardware over mikroBUS socket,
which means that you connected proper UART lines .
Trough UART you can "read" a index of the matched voice command from SpeakUp click.

Best regards,
Marina

Re: uart/speak up board

Posted: 23 Feb 2015 00:59
by middleca
Hello!

I'm having this same issue, and it looks like someone posted about this back in May 2014 as well. I'm seeing "READY" show over the UART serial line, but no command indexes for recognized voice commands. Is there a newer firmware for the "speakup click" module, or something more we can do to get this working? I have confirmed my hardware serial rig is working properly with the "READY" test, and with other microcontrollers.

Thanks,
David

Re: uart/speak up board

Posted: 23 Feb 2015 17:31
by marina.petrovic
Hi,

I believe that I answered you on this forum topic:
http://www.mikroe.com/forum/viewtopic.php?f=148&t=59758

Best regards,
Marina