energia / Energia

Fork of Arduino for the Texas Instruments LaunchPad's
http://energia.nu
Other
798 stars 670 forks source link

LCD Sharp BoosterPack SPI examples no longer work on CC13x0. #1059

Open rei-vilo opened 4 years ago

rei-vilo commented 4 years ago

The LCD_Sharp128BoosterPack_SPI_main example no longer works on the Sharp 128 against the CC1350 LaunchPad.

Only the first Hello from line 45 is displayed.

https://github.com/energia/Energia/blob/3116b847940a26176382dd6827755854a0bb0c69/libraries/LCD_SharpBoosterPack_SPI/examples/LCD_Sharp128BoosterPack_SPI_main/LCD_Sharp128BoosterPack_SPI_main.ino#L45-L46

The program seems to freeze before line 52.

https://github.com/energia/Energia/blob/3116b847940a26176382dd6827755854a0bb0c69/libraries/LCD_SharpBoosterPack_SPI/examples/LCD_Sharp128BoosterPack_SPI_main/LCD_Sharp128BoosterPack_SPI_main.ino#L52

Same for the LCD_SharpBoosterPack_SPI_main example on the Sharp 96 against the CC1350 LaunchPad.

rei-vilo commented 4 years ago

The two same examples LCD_Sharp128BoosterPack_SPI_main and LCD_SharpBoosterPack_SPI_main run smoothly on a CC1352 LaunchPad with the corresponding screens.

rei-vilo commented 4 years ago

Using a logic analyser shows the internal VCOM doesn't work as expected on the CC1310.

On the CC1350

SPI /CS goes high to select the screen, a first SCK signal goes on but nothing more. No second SCK signal and no /CS going low to deselect the screen.

Capture 2020-04-20 à 17 33 54 Capture 2020-04-20 à 17 29 05

On the CC1352

Capture 2020-04-20 à 17 33 46 Capture 2020-04-20 à 17 29 11
rei-vilo commented 4 years ago

Replacing

https://github.com/energia/Energia/blob/3116b847940a26176382dd6827755854a0bb0c69/libraries/LCD_SharpBoosterPack_SPI/LCD_SharpBoosterPack_SPI.cpp#L531-L532

by

        shiftOut(15, 7, MSBFIRST, (char)command);
        shiftOut(15, 7, MSBFIRST, (char)SHARP_LCD_TRAILER_BYTE);

seems to solve the issue.

But adding an extra SPI.begin(); before line 531 doesn't solve the issue.

I don’t know the minutiae of the implementation of TI-RTOS in Energia MT.

rei-vilo commented 4 years ago

Here are the traces after adding the patch

        shiftOut(15, 7, MSBFIRST, (char)command);
        shiftOut(15, 7, MSBFIRST, (char)SHARP_LCD_TRAILER_BYTE);

The program displays a first screen, waits for 1 second and then displays a second screen.

Trace for the CC1352

Capture 2020-04-20 à 20 44 45

Trace for the CC1350

Capture 2020-04-20 à 20 44 36
rei-vilo commented 4 years ago

As the CC1352 replaces the CC1350, the workaround at #1061 is good-enough to patch the issue.