We're on Discord! Please join our server now if you don't want to miss anything! (More info) | Join the UCC4 contest! (More info)

* WalrusIRC & Discord main room

If you have a forum account, have more than 4 posts and are not part of a restricted usergroup, then you can chat in our main Discord server room directly from here and continue using the forums at the same time. Or you can join our server directly and access many more discussion rooms!

Author Topic: TI Nspire uart  (Read 8443 times)

0 Members and 1 Guest are viewing this topic.

Offline Vogtinator

  • Full User
  • Join Date: Dec 2014
  • Location: Germany
  • Posts: 120
  • Post Rating Ratio: +4/-0
  • Instruction counter
    • @UCii1mkxAsrIGvjFwS80YSmg
    • /u/Vogtinator
    • Vogtinator
    • ../../../cgi-bin/acct-view.cgi?userid=87663#
Re: TI Nspire uart
« Reply #15 on: January 20, 2018, 10:07:17 pm »
Can you try without the exclamation mark in that line?
  • Calculators owned: TI-Nspie CX CAS, Casio FX-85ES

Offline TurtleForGaming

  • New User
  • Join Date: Jan 2018
  • Location:
  • Posts: 15
  • Post Rating Ratio: +1/-0
    • TurtleForGaming
  • Gender: Male
Re: TI Nspire uart
« Reply #16 on: January 21, 2018, 10:00:07 am »
It stilll blocking at 32 chars  :'(
  • Calculators owned: TI Nspire
Samy

Offline Vogtinator

  • Full User
  • Join Date: Dec 2014
  • Location: Germany
  • Posts: 120
  • Post Rating Ratio: +4/-0
  • Instruction counter
    • @UCii1mkxAsrIGvjFwS80YSmg
    • /u/Vogtinator
    • Vogtinator
    • ../../../cgi-bin/acct-view.cgi?userid=87663#
Re: TI Nspire uart
« Reply #17 on: January 21, 2018, 10:55:15 am »
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.
  • Calculators owned: TI-Nspie CX CAS, Casio FX-85ES

Offline TurtleForGaming

  • New User
  • Join Date: Jan 2018
  • Location:
  • Posts: 15
  • Post Rating Ratio: +1/-0
    • TurtleForGaming
  • Gender: Male
Re: TI Nspire uart
« Reply #18 on: January 21, 2018, 12:30:22 pm »
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 ?
  • Calculators owned: TI Nspire
Samy

Offline Vogtinator

  • Full User
  • Join Date: Dec 2014
  • Location: Germany
  • Posts: 120
  • Post Rating Ratio: +4/-0
  • Instruction counter
    • @UCii1mkxAsrIGvjFwS80YSmg
    • /u/Vogtinator
    • Vogtinator
    • ../../../cgi-bin/acct-view.cgi?userid=87663#
Re: TI Nspire uart
« Reply #19 on: January 21, 2018, 12:52:41 pm »
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
  • Calculators owned: TI-Nspie CX CAS, Casio FX-85ES

Offline TurtleForGaming

  • New User
  • Join Date: Jan 2018
  • Location:
  • Posts: 15
  • Post Rating Ratio: +1/-0
    • TurtleForGaming
  • Gender: Male
Re: TI Nspire uart
« Reply #20 on: January 21, 2018, 01:17:14 pm »
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.
  • Calculators owned: TI Nspire
Samy

Offline Vogtinator

  • Full User
  • Join Date: Dec 2014
  • Location: Germany
  • Posts: 120
  • Post Rating Ratio: +4/-0
  • Instruction counter
    • @UCii1mkxAsrIGvjFwS80YSmg
    • /u/Vogtinator
    • Vogtinator
    • ../../../cgi-bin/acct-view.cgi?userid=87663#
Re: TI Nspire uart
« Reply #21 on: January 21, 2018, 01:31:26 pm »
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.
  • Calculators owned: TI-Nspie CX CAS, Casio FX-85ES

Offline TurtleForGaming

  • New User
  • Join Date: Jan 2018
  • Location:
  • Posts: 15
  • Post Rating Ratio: +1/-0
    • TurtleForGaming
  • Gender: Male
Re: TI Nspire uart
« Reply #22 on: January 21, 2018, 04:06:55 pm »
After some time I managed to make this function work :w00t:. So for now my function look like this:
Code: [Select]
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.
  • Calculators owned: TI Nspire
Samy

Offline super-schaf

  • New User
  • Join Date: Oct 2018
  • Location:
  • Posts: 1
  • Post Rating Ratio: +0/-0
Re: TI Nspire uart
« Reply #23 on: October 01, 2018, 05:23:41 pm »
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


Offline TurtleForGaming

  • New User
  • Join Date: Jan 2018
  • Location:
  • Posts: 15
  • Post Rating Ratio: +1/-0
    • TurtleForGaming
  • Gender: Male
Re: TI Nspire uart
« Reply #24 on: October 02, 2018, 01:39:04 pm »
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
  • Calculators owned: TI Nspire
Samy

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games