repaper / gratis

EPD Source codes and Documentation
238 stars 132 forks source link

Provide Implementation for CC3200 and MSP432 LaunchPads on Energia #26

Open rei-vilo opened 8 years ago

rei-vilo commented 8 years ago

Support for the CC3200 is provided only with CCS6, and not with Energia.

With Energia Multi-Tasking, Energia now brings RTOS for the CC3200 and MSP432 LaunchPads.

Please adapt the libraries for the CC3200 and MSP432 LaunchPads on Energia Multi-Tasking.

rei-vilo commented 8 years ago

Results on LaunchPad

See commit d9cbf4a and pull-request #30 LaunchPad MSP430F5529, CC3200 and MSP432

rei-vilo commented 8 years ago

Is the issue with MSP432 linked to MSP432 GPIO with High-Drive capability limited to P2.0 P2.1 P2.2 P2.3?

hxw commented 8 years ago

The V231_G2 now supports MSP432P401R via the MSP-EXP board.

There is one problem though, the repaper board cannot be directly mounted as the PANEL_ON pin which would be connected to P3_6 cannot be driven high. In fact after a SPI.begin() call it seems that UCB2 is activated and pins P3_5, P3_5 and P3_7 are all assigned to this peripheral.

As a workaround the refactored I/O library assing the PANEL_On to P5_1 on this board, so use a cable connection that connects the PANEL_ON(Red,11) to P5_1 on second row of pins; rthe remaining wires are to their original pins.

hxw commented 8 years ago

I forgot to mention the SPI has to be in mode3 on the MSP432, unlike the Arduino and MSP430 which bot use mode0. Is the mode->pol/pha mapping correct in MSP432 driver?

(I know the two bits have different definitions this is one view http://www.byteparadigm.com/kb/admin/media_store/2/AA-00255/figure3.jpg from: http://www.byteparadigm.com/applications/introduction-to-i2c-and-spi-protocols/ )

Seem from https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus that only PIC32MX has 1:1 config bits to mode mapping.

rei-vilo commented 8 years ago

CC3200 and CC3200 EMT

I managed to get it work on CC3200 EMT, after fixing

long S5813A_Class::readVoltage(void) {
    long vADC = analogRead(this->temperature_pin);

// Added for CC3200 EMT    
#if defined(ENERGIA_MT)
#if defined(__CC3200R1M1RGC__) || defined(__CC3200R1MXRGCR__)
    vADC *= 4;
#endif
#endif
// End
/*
    Serial.print("analogRead=");
    Serial.print(vADC);
    Serial.print("\treadVoltage=");
    Serial.println(REV_PD((vADC * ADC_MAXIMUM_mV) / ADC_COUNTS));
 */
    return REV_PD((vADC * ADC_MAXIMUM_mV) / ADC_COUNTS);
}
static void SPI_on(void) {

    // Energia EMT freezes on SPI.end() if no previous SPI.begin()
    // Dummy SPI.begin()
    SPI.begin();

    SPI.end();
    SPI.begin();
    SPI.setBitOrder(MSBFIRST);
...

MSP432 EMT

Still no luck on the MSP432.

Temperature = 19 Celsius dc_state = 0x0 EPD: DC failed

I'm going to test mode 3.

rei-vilo commented 8 years ago

SPI mode 3 is indeed activated in MSP432. Still no display.

Demo version: 5 Display size: EPD_2_7 Film: V231 COG: G2

Image 1: text_image_2_7.xbm Image 2: cat_2_7.xbm

unsupported EPD FLASH chip: MFG: 0x84 device: 0x80A6 Temperature = 18 Celsius EPD: DC failed