Overblog Suivre ce blog
Editer la page Administration Créer mon blog
Xtase & Androids

TI nSpire Bluetooth Serial Interface

/!\ This is only my own experience, you may destroy your equipment, so ... At your OWN risk ... /!\

(a more readble version of this doc is posted here

1) The goal
This page will try to explain how we can plug serial bluetooth connection to TI nSpire dock connector RX/TX pins.
Sorry for that, but this document won't help you to connect a wireless PS4 controller to your calc... :) It's for communication purposes only.

All that work is interesting if : you've got a jailbroken TI nSpire & that you know what ndless programming is, else you will only be able to see a collection of TI internal logs.
2) BT Calc Usages
  • Debug the whole calc behaviour with built-in logging system
  • make programs with Ndless that can deal with uart
    • make ~multi player~ games (@ this time not TI to TI) / (but TI to PC for example)
    • use computer, phone or tablet as a server to bring files, internet access ... to your calc 
    • write ndless 'independent' LINK programs
3) BT module choice
TI nSpire Bluetooth Serial Interface

I choose the F2M03GLA bluetooth module, because it's a simple (& cheap) UART to BT module.
It is easily configurable via COM (USB UART OR RS232+MAX232)

but BEWARE : it's a 3.3v powered & driven device ( as your TI :) )

4) BT module configuration
TI nSpire Bluetooth Serial Interface

As I did, you can use a 5v driven USB UART (that have a regulated 3.3v output),
in that case you'll have to protect the RX module pin, to ensure 5v to 3.3v signal adaption, you can use two (10K & 15K) resistors.

If you haven't any 5v to 3.3v regulator for the power supply you can use a TPS73633 chip. (not in the picture)

TI nSpire Bluetooth Serial Interface

If you have a 3.3v driven USB UART, you can directly provide Vcc & you do not need to protect bt module RX pin.

The last remaining problem, to connect the module to TI, is the used BAUD RATE : the F2M03GLA use 38400bps (8N1) as default setting, but the calc uses 115200bps (8N1).

So we need the UART to 1st configure the BT module serial settings.
  * U can try the provided software : 'F2M_BlueCFG_3_03.exe' (It didn't worked for me)
  * Else you can try pseudo code that I provide (in the language/computer you want but not on the TI) : 

// this code is must be launched before any BT connection
byte[] enterInHcm  ={0x01, 0x04, 0xFF, 0x00, 0x55, 0xAA };
byte[] setBauds    ={0x15, 0x05, 0X07, 0x01, 0x00, 0x08, 0x01};
byte[] exitFromHcm ={0x50, 0x00 };

UART.connect(38400, 8, 'N', 1);
 UART.writeBytes( enterInHcm );
 UART.read(); UART.read(); // cmd code & response length
 UART.read(); // check that the response is 0x01 for success
  
 UART.writeBytes( setBauds );
 UART.read(); UART.read(); // cmd code & response length
 UART.read(); // check that the response is 0x01 for success
  
 UART.writeBytes( exitFromHcm );
 UART.read(); UART.read(); // cmd code & response length
 UART.read(); // check that the response is 0x01 for success
UART.disconnect();

// the 0x07 byte in 'setBauds' means that we are now @ 115200bps (still 8N1)

Please note that all the doc. can be found in the "Wireless UART Protocol" manufacturer PDF file

TI nSpire Bluetooth Serial Interface

I suggest you to use the F2MADAP1 circuit to solder efficiently the needed pins (Vcc, TX, RX, GND).

Now that the bluetooth module is ready to work @ 115Kbps (test it while it's still plugged to UART USB board), we will be able to connect it to the TI nSpire

5) BT testing advices
As I'm a Java developper, I used a test suite composed of Java code + bluecove API,
I provide a testing package for Windows PCs (but you can replace the bluecove-2.1.0.jar with your platform needs).
- Just notice that this bluecove version is a bit old & requires a 32bit JVM (can't run on 64bit JVM) even if it can run on a 64b OS -
   for more info see : https://code.google.com/p/bluecove


In the pseudo-code above, we did not change the default F2M03GLA behaviour : it run as "End Point Mode" (Cf manufacturer vocab.)
That means that the module will not connect to a given machine, it'll act as a ~Connection Server~ then all your other devices will be able to connect to it. 
By this way, you will be able to write softwares for PCs, Raspberries, Androids ... & whatever platform that can make some serial BT connections (aka SPP) to deal with your TI nSpire.


So get the MAC address written on the little label of the module itself, or make a scan with BTScanner.java or the bluetooth configuration tool of your OS.
The module will be named as "Free2move WU"...
Then you can run BTClient.java w/ that MAC @ to read the module output.

/!\ ... you may destroy your equipment, so ... At your own risk ... /!\

6) TI nSpire back(dock) connector
At the rear side of your TI, there's a bottom connector called dock connector, it contains a lot of usefull pins but we will use only 4 of those.
TI nSpire Bluetooth Serial Interface

Vcc (2), RX (3), TX (4), GND (5)
* Vcc is the 3.3v voltage line,
* RX is the data receiving line it's limited to 3.3v and doesn't support 5v,
* TX is the data transmitting line (3.3v too),
* GND is the ground line.

You'll may want to solder pins directly or something like that ... that's your problem, not mine ;)


But remember to remove the battery before any operation because if you short two or more pins : YOU MAY DESTROY YOUR CALC !!!

Then think that the TX of your calc is the RX of the BT module & as opposite.

The remaining text may help you anyway so continue reading please....

So I suggest to you my solution, it's not necessarily the best solution, but it's how I proceed & why...

7) TI Lab Craddle Hack
As I bought a TI Lab Craddle, I couldn't (& didn't want to) solder pins of the TI to the F2M03GLA.
I decided to hack my lab craddle to handle it, and as it contains a second battery pack, it was good point too.

  * 1st I removed the battery

  * I checked the connector (& noticed that it was numbered as opposite of all docs that I found on the web, as on the picture above)
  the pin 26 is the 1st of the calc & the pin 26 of the calc is the 1st of the dock

  * I tried to solder my wires @ top of pins but w/o any success : the connector & the calc are just enought close to be in contact

  * so I had to solder by the bottom ;( -- notice that if the PCB is double sided, the connector doesn't out on the lower side, it's surface soldered.
TI nSpire Bluetooth Serial Interface
TI nSpire Bluetooth Serial Interface

* I soldered my 4 wires (w/o anything @ the other side) - to the surface ~legs~ of the connector 
   (I used ~2cm iron soldered wire sections that I re-fold on each self to be sure to make a good contact inside the connector body).

  * Then pushed a little piece of paper to lock the wires.

  * When it was done, I used an ohm meter to control that :
   - Each wire was correctly soldered to its dock visible pins
   - Each wire was not soldered to another pin (even it can have a few resistance value betwen some pins, It shouldn't be 0ohm)
   - That's why you must remove the battery.

TI nSpire Bluetooth Serial Interface

  * It took me a couple of hour for my system to be sharp enought ! so be patient, & re-test your wires @ each step

  * I let run my cable ( a piece of floppy ribbon ) under the PCB, then make it out by the battery connector hole

  * Soldered my wires to a perfboard in order they don't touch each-other

  * I re-screwed the PCB, re-tested all my wires with ohm meter

  * Re-screwed the cover, and again re-tested all my wires (beware of tiny reset plastic button)

  * Plugged the battery back, blocked up the craddle locking system (else it should torn your wires)

  * Powered ON my TI calc & inserted it into craddle then ...

No reboot, (means no shortcut), it launched Vernier Data Quest application !
I closed it, now we can attach the BT module ! (@ this point, I plugged the previous mentioned USB UART on TX to test that my cable was OK)

8) Wiring BT module to TI Craddle
/!\ Remember that you may destroy your equipment, so ... At your own risk ... /!\
TI nSpire Bluetooth Serial Interface

* remember to remove the craddle battery before any operation

* RX module on TX craddle/calc, TX module on RX craddle/calc, Vcc on Vcc, GND on GND & that's all !

* Add a ~PWR switch~ to the module on GND in order to lock all signals & Vcc, It'll avoid to drain batteries.

N.B. : See the pinout for adapter circuit. Note that if you use regulated voltages (it's that case w/ TI nSpire) : you may use the circuit w/o any additional component.

9) TI nSpire & BT Module together
With the BTClient that I provided (& your BTmodule MAC @), you can now try to read module output :

Here's an example of launching a LUA game (jeux/CityCX.tns) on TI calc :

BlueCove version 2.1.0 on winsock
Local Address:60029259F8CC+n => FGSURFACE
Enter BTmodule mac address (ex. 000BCE04FB85) > 000BCE04FB85
Ctrl - C to exitBTmodule Found:000BCE04FB85

IME: non-ALPHA key pressed
IME: non-ALPHA key pressed
IME: non-ALPHA key pressed
Product   : 15 (defined in os/inc/deviceinfo.h)
Platform  : 1 (defined in documentmanager/inc/hal.h)
Version   : 3.6.0.546 CAS
Build Date: 2013-9-11
16:25:25.260,15-10-25,0000028026,Product: 15 (defined in os/inc/deviceinfo.h)
?[0m16:25:25.270,15-10-25,0000028027,Platform: 1 (defined in documentmanager/inc
/hal.h)
?[0m16:25:25.280,15-10-25,0000028028,Version: 3.6.0.546 CAS
?[0m16:25:25.280,15-10-25,0000028028,Date: 2013-9-11
?[0m16:25:29.950,15-10-25,0000028395,Doc open complete in 4.11999989 seconds for
: jeux/CityCX.tns
?[0m16:25:29.950,15-10-25,0000028395,Memory avail before open: 35542308.  Memory
 avail after open: 32216468.  Memory used: 3325840
?[0m			 

Et voila !, now it's your turn to write some programs that can use the built-in TI-UART,
Note that TI nSpire OS <= 3.1 can directly print() via LUA program, mine is a 3.6 CX CAS so I need to use ndless...

I tested the SDK sample named 'luaext' (see that link for more info) that prints some 'hello XXX !\n' strings as a 'luax' extension, but it is very unstable & may reboot your calc when closing LUA programs :( , but it can be a starting point for testing your system.

I'll try in a near future to post some usefull (or not) codes to use that feature (I also have a project of wiring a 3.3v Arduino to drive BT & other devices/UARTS...).


Enjoy & have a good day.

Partager cette page

Repost 0