Dear visitors and members, with the staff having moved on to other life interests and as a result of changes in people's internet usage habits, the CodeWalrus community have migrated almost entirely to Discord, IRC and WalrusIRC and is now essentially a place where to hang out, chat about gaming, programming, music, anime, and chill. As a result, even though the CW forums will remain open for posting, for faster TI, Casio or HP calculator help and news we recommend using the bilingual TI-Planet forums instead.

We encourage everyone to join our Discord server now.

* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: TI Nspire uart  (Read 5384 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: 13
  • 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: 13
  • 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: 13
  • 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: 13
  • 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

 


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