The shoutbox is currently out of service. Join us on Discord instead.

TI Nspire uart

Started by TurtleForGaming, January 20, 2018, 01:44:33 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Vogtinator

Can you try without the exclamation mark in that line?

TurtleForGaming

It stilll blocking at 32 chars  :'(
Samy

Vogtinator

I'm not sure what I can do with remote debugging here...

I'd suggest you try some more ways to configure the PL010 UART, maybe try turning the FIFO off.
There's also still the possibility that there's something wrong on the sender's side.

TurtleForGaming

Well can I increase the FIFO buffer size. If not you said that I can write an interrupt for reciveing data but I dont really know how to do that. And if all of that is not really possible how do I disable it ?
Samy

Vogtinator

You can't change th FIFO size, it's the hardware.

For the other questions, take a look at the PL011 manual: http://infocenter.arm.com/help/topic/com.arm.doc.ddi0183f/DDI0183.pdf

TurtleForGaming

So I have read the whole pdf but I don't see how to make an interrupt. For first I doesn't done so much C and I absolutly don't know how to make an interrupt but the one thing that I have seen fromthe pdf is that there is a byte to see if the receive FIFO is 1/2 full but I don't know how to make it work.
Samy

Vogtinator

Interrupts aren't required to get it to work if you do everything in a loop.

Just try to configure the UART slightly differently, the register offsets and what the various bits do is all explained within the PDF document.

TurtleForGaming

After some time I managed to make this function work :w00t:. So for now my function look like this:
char* uart_getsn(char* str, int num) {
        int i = 0;
        int max = num-1;
        while(1 && releasefunc()) {
                while(uart_ready() && isKeyPressed(KEY_NSPIRE_ESC)) {
                        if(i == max) {
                                str[i] = 0;
                                return str;
                        }
                        char c = uart_getchar();
                        str[i] = c;
                        if(c == '\b'){  i -= 2; }
                        else if(c == '\r')      { str[i] =0; return str; }
                        i++;

                }
        }
}


definitvely not perfect since i have to send \r after each command  and I have added  isKeyPressed(KEY_NSPIRE_ESC) to the while in case of stuck (append only one time) but I work for me.
Samy

super-schaf

Hello there!

I was just doing some research, prior to starting a uart chat interface for the nspire, when I stumbled upon your lovely posts.
Great to hear someone else out there in the interwebs has the same interest!

I was wondering, Samy, if you have developed your idea any further than the previous posts suggests?
So far you have already saved me a stack of time starting from scratch, and if possible, I'd love to co-op with you to continue on this app.

With warm regards from Switzerland,
Richard


TurtleForGaming

While I don't exactly understand you question I'm glad to hhave helped you for something and I indeed continued to work on this project after this post and the program evolved into this:
https://github.com/TurtleForGaming/nspire-communication/blob/master/nspire-client/uart_sms/hello.cpp And if you want to see the whole project look at this post: https://codewalr.us/index.php?topic=2299.0
Samy

Powered by EzPortal