Jump to content
sumotoy

[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.

post-4320-14264605474129_thumb.jpg

 

Here's the proof that it's working:

post-4320-14264605474642_thumb.jpg

 

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:

https://github.com/sumotoy/RA8875

 

Share this post


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.)

Share this post


Link to post
Share on other sites

@@sumotoy,

 

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.

 

Regards

John K

Maker and Robot Builder

Share this post


Link to post
Share on other sites

hi,

looks like closed by robertinant almost one year ago.

I'm confused now, SPISetClockDivider should works as it suppose? It divide the 80Mhz of stellaris or max speed is limited to 24Mhz?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×