• Zeda's Hex Codes 5 1
Currently:  

Author Topic: Zeda's Hex Codes  (Read 66891 times)

0 Members and 2 Guests are viewing this topic.

Offline Shmish21

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +0/-0
    • View Profile
Re: Zeda's Hex Codes
« Reply #75 on: September 28, 2020, 01:21:21 pm »
How would you make the I/O port set the ring and tip to high/low and stay there? (Tried to add in my own native assembly but it didn't work, also sorry for posting on a potentially dead Forum)

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Zeda's Hex Codes
« Reply #76 on: September 28, 2020, 02:14:23 pm »
In binary, when you write 00 to port 0, it sets the two lines to 1 (HIGH maybe?). Basically, what you write gets inverted.
When you write a 0 to one of the lines, you kind of release it, but when you write a 1 (setting the line LOW?), you kind of lock it there.

So when you have two calculators connected, and one sets the lowest bit to LOW, the other calculator cannot pull it HIGH. But when the line is already HIGH, either or both calculators can bring it LOW.
When both calculators bring a line LOW, it remains LOW until all calculators have "released" it back to high.

A TI-OS-related caveat: at the home screen or in a BASIC program, if the lines are not released, the calc will basically be frozen, so before you return control back to TI-OS, make sure to write a 0 to port 0 (this brings both lines to 1).

Now, given the topic, I would assume that you want a hexcode. There are many ways to interact with the port, but the very basics: 3E0xD300, where x is 0, 1, 2, or 3 will write to the port, and DB00 will read from the port.

Offline Shmish21

  • LV0 Newcomer (Next: 5)
  • Posts: 2
  • Rating: +0/-0
    • View Profile
Re: Zeda's Hex Codes
« Reply #77 on: September 28, 2020, 04:53:31 pm »
In binary, when you write 00 to port 0, it sets the two lines to 1 (HIGH maybe?). Basically, what you write gets inverted.
When you write a 0 to one of the lines, you kind of release it, but when you write a 1 (setting the line LOW?), you kind of lock it there.

So when you have two calculators connected, and one sets the lowest bit to LOW, the other calculator cannot pull it HIGH. But when the line is already HIGH, either or both calculators can bring it LOW.
When both calculators bring a line LOW, it remains LOW until all calculators have "released" it back to high.

A TI-OS-related caveat: at the home screen or in a BASIC program, if the lines are not released, the calc will basically be frozen, so before you return control back to TI-OS, make sure to write a 0 to port 0 (this brings both lines to 1).

Now, given the topic, I would assume that you want a hexcode. There are many ways to interact with the port, but the very basics: 3E0xD300, where x is 0, 1, 2, or 3 will write to the port, and DB00 will read from the port.


Thank you so much, your knowledge on this stuff is outstanding! Another quick question I have is what would each of the different statuses do exactly. I know you already explained what writing 00 and 01 do, but if possible could you put what each does 0-3. It would help to be able to reference back to it.

P.S. I am using the I/O port for 1 bit sound purposes.
« Last Edit: September 28, 2020, 05:01:54 pm by Shmish21 »

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Zeda's Hex Codes
« Reply #78 on: September 28, 2020, 05:23:48 pm »
The numbers in binary:
0 ==> 00
1 ==> 01
2 ==> 10
3 ==> 11

So writing a 3 brings both lines LOW, writing 2 sets the upper line LOW and the lower line HIGH.
Writing 0 and 1 do the opposite of 3 and 2, respectively.

The routine here might be useful to you :)