RS232 with Nspire IO

Hello,
I'm trying to communicate with my device via RS232. I'm running OS version: 4.2.0.532 and Ndless 4.2.0 cas cx
Initially I tried to communicate with LUA and the Asynchronous Serial Interface library with no prevail.
Next I installed ndless and downloaded the nspire io library.
I was having issues with the provided tests demo. When the code tried to write and save the file, I would get an ownership error. I removed this and now I have the following code.
I have my Nspire connected directly to my COM1 port via a 9 pin connector.
I start Putty listening to COM1 @ 115200 baud.
Data bits: 8
Parity: Even
Stop bits: 1
Flow control: None
When I run the test I get a string of nonsense, so this leads me to believe I have the wrong port settings. Does anyone know the correct settings?
Also when I look at the code I see uart_getsn(input,100);
Is this the serial port listening for input from the computer? When I execute the code it says "Testing Uart..." then straight to tests finished, shouldn't there be some type of pause there?
And on an unrelated note, how do I get the website to stay in English? It wants to change every time I reload a new page. I've tried the English flag in the upper right hand corner.
I'm trying to communicate with my device via RS232. I'm running OS version: 4.2.0.532 and Ndless 4.2.0 cas cx
Initially I tried to communicate with LUA and the Asynchronous Serial Interface library with no prevail.
Next I installed ndless and downloaded the nspire io library.
I was having issues with the provided tests demo. When the code tried to write and save the file, I would get an ownership error. I removed this and now I have the following code.
- Code: Select all
#include <os.h>
#include <nspireio/nspireio.h>
int main(void)
{
assert_ndless_rev(874);
clrscr();
nio_console csl;
nio_init(&csl,NIO_MAX_COLS,NIO_MAX_ROWS,0,0,NIO_COLOR_WHITE,NIO_COLOR_BLACK,TRUE);
nio_set_default(&csl);
nio_color(&csl,NIO_COLOR_BLACK,NIO_COLOR_WHITE);
nio_puts("Nspire I/O testing tool\n");
nio_color(&csl,NIO_COLOR_WHITE,NIO_COLOR_BLACK);
nio_printf("Compiled %s %s\n",__DATE__,__TIME__);
nio_puts("Press any key to flush console...\n");
nio_drawing_enabled(&csl,FALSE);
nio_putchar('A');
nio_fputc('a',&csl);
nio_putchar('\n');
nio_puts("Color palette test:\n");
int i, j;
for(i = 0; i < 16; i++)
{
for(j = 0; j < 16; j++)
{
nio_color(&csl,i,j);
nio_putchar('X');
}
nio_putchar('\n');
}
nio_color(&csl,NIO_COLOR_WHITE,NIO_COLOR_BLACK);
nio_puts("This line is too long for the Nspire's screen so we have to continue it on the next line...\n");
wait_key_pressed();
nio_fflush(&csl);
nio_drawing_enabled(&csl,TRUE);
nio_puts("Enter text:\n");
char input[100] = {0};
nio_getsn(input,100);
nio_printf("Your text was:\n%s\n",input);
nio_puts("Enter a number: ");
int num;
nio_puts("Testing UART...\n");
uart_puts("Nspire I/O testing tool\n");
uart_printf("Compiled %s %s\n",__DATE__,__TIME__);
uart_puts("Enter text: ");
uart_getsn(input,100);
uart_printf("Your text was: %s\n",input);
nio_puts("Tests finished.");
nio_free(&csl);
wait_key_pressed();
return 0;
}
I have my Nspire connected directly to my COM1 port via a 9 pin connector.
I start Putty listening to COM1 @ 115200 baud.
Data bits: 8
Parity: Even
Stop bits: 1
Flow control: None
When I run the test I get a string of nonsense, so this leads me to believe I have the wrong port settings. Does anyone know the correct settings?
Also when I look at the code I see uart_getsn(input,100);
Is this the serial port listening for input from the computer? When I execute the code it says "Testing Uart..." then straight to tests finished, shouldn't there be some type of pause there?
And on an unrelated note, how do I get the website to stay in English? It wants to change every time I reload a new page. I've tried the English flag in the upper right hand corner.