π
<-

hardware control

C, C++, ASM...

hardware control

Unread postby parisse » 05 Jun 2020, 20:02

I made some progresses in order to "simulate" OFF/ON inside KhiCAS by setting the backlight to 0. If a student enters KhiCAS during the math course and presses OFF then ON 5 minutes later, the current code (see below) is ok, but if the calc stays like this a few days, this will probably drains the batteries too much. I wonder how I could improve it in order to decrease power consumption.
The current code looks like this
Code: Select all
...
    if (allow_suspend && nspire_ctrl && on_key_pressed()){
      nspire_ctrl=false;
      while (on_key_pressed())
   msleep(10);
      // somewhat OFF by setting LCD to 0
      unsigned NSPIRE_CONTRAST_ADDR=0x900f0020;
      unsigned oldval=*(volatile unsigned *)NSPIRE_CONTRAST_ADDR;
      *(volatile unsigned *)NSPIRE_CONTRAST_ADDR=0x100;
      while (!on_key_pressed())
   msleep(100);
      *(volatile unsigned *)NSPIRE_CONTRAST_ADDR=oldval;
      statusline(0);
      sync_screen();
      continue;
    }
...

I also tried to write to the led (I have introduced the read32 and write32 commands to make tries easy inside the KhiCAS shell), but it seems to be locked:
Code: Select all
16=>=>
l=0x90110b00
a=read32(l)
b=0b1010011
write32(l,b)

read32(l) stills return 0x1643
(N.B. 16=>=> is a KhiCAS command to display integers in hexa).
User avatar
parisseVIP++
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 89.4%
 
Posts: 3721
Joined: 13 Dec 2013, 16:35
Gender: Not specified
Calculator(s):
MyCalcs profile

Re: hardware control

Unread postby critor » 05 Jun 2020, 20:28

Yes, on recent Nspire versions and hardwares, the LED port is locked by at least 2 other ports if I remember well.
You had to write to those other ports to unlock it, it may not work anymore.

If I remember well, information about these ports is/was available on Cemetech and Omnimaga.

Although, if you unlock the LED, the calculator is going to reboot some seconds after you're back to the OS (after exiting the Ndless program, KhiCAS in your case). Even if you reset the LED to its original state and relock it before exiting.
So unlocking the LED is either not a solution, or not enough.
Image
User avatar
critorAdmin
Niveau 19: CU (Créateur Universel)
Niveau 19: CU (Créateur Universel)
Level up: 51.3%
 
Posts: 42240
Images: 16685
Joined: 25 Oct 2008, 00:00
Location: Montpellier
Gender: Male
Calculator(s):
MyCalcs profile
YouTube: critor3000
Twitter: critor2000
GitHub: critor


Return to Native: Ndless, Linux, ...

Who is online

Users browsing this forum: ClaudeBot [spider] and 4 guests

-
Search
-
Social TI-Planet
-
Featured topics
Comparaisons des meilleurs prix pour acheter sa calculatrice !
"1 calculatrice pour tous", le programme solidaire de Texas Instruments. Reçois gratuitement et sans aucune obligation d'achat, 5 calculatrices couleur programmables en Python à donner aux élèves les plus nécessiteux de ton lycée. Tu peux recevoir au choix 5 TI-82 Advanced Edition Python ou bien 5 TI-83 Premium CE Edition Python.
Enseignant(e), reçois gratuitement 1 exemplaire de test de la TI-82 Advanced Edition Python. À demander d'ici le 31 décembre 2024.
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
1234
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...
Donate
Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
1182 utilisateurs:
>1144 invités
>32 membres
>6 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Other interesting websites
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)