Adafruit TFT 2.8" test program for FRDM-K64F Note: J11 must be cut to make TSC work, but to download the program it must be reconnected, use pin-header and jumper.

Dependencies:   MMA8451Q SPI_STMPE610 SPI_TFT_ILI9341 TFT_fonts mbed

This program was to test Adafruit 2.8" TFT with touch with FRDM-K64F. After download the binary to the FRDM-K64F and push the reset button , a simple welcome message will be displayed.

このプログラムは私が秋月で購入した Adafruit 2.8" TFT http://akizukidenshi.com/catalog/g/gM-07747/ をFRDM-K64F で試すために書いたものです。 ダウンロード後にFRDM-K64Fのリセットスイッチを押すと 最初の画面が表示されます。

/media/uploads/Rhyme/img_0979_s.jpg

If you push and keep the right side of the screen, the screen will advance to the page2, which is a simple graph sample.

ここで画面の右側をしばらく押していると、次のページに移行します。 このページでは、簡単なグラフを表示する例を描画しています。

/media/uploads/Rhyme/img_0980_s.jpg

And if you do the same again, the program advances to the page3, which is a data display page of MMA8451Q accelerometer mounted on the FRDM-K64F. Note: Actually FRDM-K64F has FXOS8700CQ Acc + Mag, but it can emulate MMA8451Q.

さらに画面の右側をしばらく押していると、次のページに移行します。 ここでは、FRDM-K64Fに搭載されている MMA8451Q という3軸の 加速度センサの値を表示しています。 ※ 実はFRDM-K64F に搭載されているものは FXOS8700CQ というセンサなのですが、MMA8451Qのフリもしてくれるので、それを利用しています。

/media/uploads/Rhyme/img_0981_s.jpg

And this is the last page of this program, so far, so if you try to advance page, it will return to the first page. Note: Because of some bug, sometimes the clear screen fails and drawing of the page is screwed, but if you advance page or push reset button, usually it will return to normal picture.

このページが最後のページになっているので、さらにページ送りをすると 最初のページに戻ります。 ※ プログラム(もしくはライブラリ)のどこかに虫がいるようで ときどき画面消去に失敗して、複数の画面が重ね描きされたりします、 ページ送りをするか、リセットボタンを押すと通常状態に復帰できます。(^ ^;

Note: Probably some noticed that push and keep left side move the screen to the previous page. ※ 画面の左側を押し続けると、前のページ戻ることに  気づかれたかたもおいでかと思います。

/media/uploads/Rhyme/img_0982_s.jpg

BTW, I encountered a nasty problem with this setup, since OSBDM and TSC shares the same pin, you must cut the jumper at J11 to make TSC work, but you must reconnect it to make downloading work. At first I put the jumper pin on the top of the FRDM-K64F, but with this I had to remove the TFT everytime re-loading the program, which made me pretty unhappy, so I asked my friend to put a L-type jumper on the bottom of the board, so that the TFT panel can stay.

ところで、このセットアップの場合、OSBDMとTSCがピンを共用しているために、TSCを使えるようにするためには、J11のジャンパパターンを切る必要がありました。しかしプログラムをダウンロードするためには再度J11をショートする必要が出てきます。 最初、ジャンパピンを基板の上側につけたのですが、そうするとプログラムの度にTFTを外す必要が出てきます。耐えられなくなって友人にL型のジャンパピンを基板の裏側につけてもらうことで解決を見ました。

3-Jun-2015 With the newest FRDM-K64F TSC stopped working.!
After spending a few days, finally I found that the D8 pin which originally was PTA0 is now PTC12 !!
So for those with FRDM-K64 board rev E or later
The good news is that you don't have to cut the J11 anymore
The bad news is change pin definition for PIN_CS_TSC from PTA0 to PTC12.

For FRDM-K64F rev.E or later

#define PIN_CS_TSC   PTC12

2015年6月3日 最近のFRDM-K64Fでタッチセンサが効かないことがわかりました!
数日戦ったところ、D8に接続されているピンが PTA0 から PTC12 に変わっていることがわかりました!!
もしお持ちのFRDM-K64Fの基板リビジョンが E 以降であれば
良い報せとしては、もう J11 を切ってジャンパを付ける必要がなくなりました。
悪い報せとしては、コード内で TSC CS の定義を PTA0 から PTC12 に変更してください。

For FRDM-K64F rev.E or later

#define PIN_CS_TSC   PTC12