Jump to content

[Energia Library] RA8875 for Energia/Arduino/Teensy3.x

Recommended Posts

Hello, I'm new on Energia but experienced with Teensy3 stuff (that uses Arduino IDE). I've recently coded a library for RA8875 TFT driver chip and since I got from a friend a Stellaris Launchpad that uses LM4F120XL MCU, I decided to include Energia in the chain. The actual beta (0.55) worked very nice with Energia and Stellaris but dunno the other MCU compatible with Energia so maybe someone can check.

Here's the test setup, I've used module 3 for SPI.



Here's the proof that it's working:



During development I (maybe) find a small bug in Energia. I have a println detect code that working pretty good with Arduino IDE, it detects \r followed by \n for println.

Energia seems send only \n. It's not such a big problem but maybe some library that uses serial communications can be affected so better know and maybe some investigation about...

Also, I cannot find much informations about how to recognize the different MCU's compatible with Energia, in my RA8875.h file I wroted a quick and dirty version but because of my ignorance on those processors maybe I'm wrong... At this time I've understand that Stellaris and Tiva uses setModule stuff, MSP430,TMS320F28069 and __CC3200R1M1RGC__ not, I'm right?


As I said, I'm new on Energia and Stellaris but I'm really surprised of how well it's working and the inexspensive Stellaris it's tons better than a DUE so I'm excited to get more hardware stuff and test and contribute as I can with Energia.

On GitHub:



Link to post
Share on other sites

Another question about SPI speed. RA8875 has a SPI speed limit from his Xtal. My TFT (and almost all I seen around) uses 20Mhz Xtal so:

Write SPI max speed: 6.67Mhz

Read SPI max speed: 3.34Mhz

Stellaris has 80Mhz clock so the nearest division parameter will be:

Write:SPI_CLOCK_DIV16 (5Mhz)

Read:SPI_CLOCK_DIV32 (2.5Mhz)


Question is:

1) SPI_CLOCK_DIV works as supposed or there's some missing information that I need to know?

2) I've noticed that F_CPU it's present in energia, can I used it or it's not working correctly for all the MCU's?


(note:I will like to modify SPI library to support SPI Transactions as Teensy3 0x21 and Arduino 1.5.8, it's really useful since I can choose the speed I want literally without interfere with other SPI devices.)

Link to post
Share on other sites



I ran across this a while ago. Energia does not change the Stellaris/TivaC clock based on F_FPU. It is always 80Mhz!  I modified Wiring.c timerInit() at one time to use F_CPU. However I also hadto modify timer5, and systick as well as the timer routines. I did this due to the fact that an application I had needed 50mhz for hardware interfaces. I later found out a way to get the H/W interface to run faster and abandoned this. I also changed timer5 to one of the wtimers in order to get 64 bits on millis() for loong running applications. I also found out later how to use the 32-bit millis(). I also believe there MAY have been a bug in millis that only gave 16-bit results due to math overflow/truncation. I don't quite remember.



John K

Maker and Robot Builder

Link to post
Share on other sites
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...