This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP-MSP430FR2476: SPI slave MAX17841

Part Number: LP-MSP430FR2476

I have been able to get the correct response to the daisy chain initialization sequence using the MSP430 SPI and the MAX17841 (Table 10) connected to one MAX17853. Wake up and HELLO ALL transactions receive the correct responses on the MISO line, I get a device address that is returned as 0x001. This is the same as the Maxim evaluation GUI. These MSP430 SPI responses have been captured on the scope.

Now, I need to get Table 11 from MAX17841 working. I sent out transaction 1, 2, and 3 (WriteAll_transactions[0].Data[0] = 0xc0;   WriteAll_transactions[1].Data[0] = 0xb0; WriteAll_transactions[2].Data[0] = 0x01;) but I don't get the receive of 0x12. Instead I get a 0x11 (sometimes 0x21) which means there is an RX_Overflow_Status or there is unread data. I don't understand why this is. The commands 0xC0 and 0xB0 worked fine in the transactions from Table 10. With the evaluation GUI, Table 11 works fine. So something is missing from the MSP430 handshaking. I appreciate any pointers. I have attached my current file to this post.

I tried including and removing the PEC byte from WriteAll_transactions[0] without any difference in slave response.

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>

#include <driverlib.h>
#include <intrinsics.h>
#include <msp430.h> 
#include "clock~.h"                 // Clock configurations

#define UART_TRANSMIT_BUFFER_LENGTH  76
#define UART_TXD_PORT        GPIO_PORT_P1
#define UART_TXD_PIN         GPIO_PIN4
#define UART_RXD_PORT        GPIO_PORT_P1
#define UART_RXD_PIN         GPIO_PIN5
#define UART_SELECT_FUNCTION GPIO_PRIMARY_MODULE_FUNCTION

#define SPI_MOSI_PORT       GPIO_PORT_P2
#define SPI_MOSI_PIN        GPIO_PIN6
#define SPI_MISO_PORT       GPIO_PORT_P2
#define SPI_MISO_PIN        GPIO_PIN5
#define SPI_CLK_PORT        GPIO_PORT_P2
#define SPI_CLK_PIN         GPIO_PIN4
#define SPI_SELECT_FUNCTION GPIO_PRIMARY_MODULE_FUNCTION



typedef struct {
    uint8_t    Len;
    uint8_t    Data[10];
} spi_MaximTrans_t;

static uint8_t RXData[8] = {0};           //SPI receive byte
/**
 *  Initialize system clocks
 */
static void init_clock(void) {
    // Configure one FRAM waitstate as required by the device datasheet for MCLK
    // operation beyond 8MHz _before_ configuring the clock system.
    FRAMCtl_configureWaitStateControl(FRAMCTL_ACCESS_TIME_CYCLES_1);

    //Set DCO FLL reference = REFO
    CS_initClockSignal(CS_FLLREF, CS_REFOCLK_SELECT,   CS_CLOCK_DIVIDER_1);
    //Set ACLK = REFO
    CS_initClockSignal(CS_ACLK,   CS_REFOCLK_SELECT,   CS_CLOCK_DIVIDER_1);

    CS_initFLLParam param = {0};
    //Set Ratio/Desired MCLK Frequency, initialize DCO, save trim values
    CS_initFLLCalculateTrim(CS_MCLK_DESIRED_FREQUENCY_IN_KHZ, CS_MCLK_FLLREF_RATIO, &param);

    //Set MCLK = REFO
    CS_initClockSignal(CS_MCLK,   CS_REFOCLK_SELECT,   CS_CLOCK_DIVIDER_1);
    //Set SMCLK = DCO
    CS_initClockSignal(CS_SMCLK,  CS_DCOCLKDIV_SELECT, CS_CLOCK_DIVIDER_1);

    //Clear all OSC fault flag
    CS_clearAllOscFlagsWithTimeout(1000);
}

/**
 *  Initialize all of the IO pins per their configuration
 */
static void init_gpio(void) {
    // Set all GPIO pins to output low to prevent floating input and reduce power consumption
    GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN_ALL8);
    GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN_ALL8);
    GPIO_setOutputLowOnPin(GPIO_PORT_P3, GPIO_PIN_ALL8);
    GPIO_setOutputLowOnPin(GPIO_PORT_P4, GPIO_PIN_ALL8);
    GPIO_setOutputLowOnPin(GPIO_PORT_P5, GPIO_PIN_ALL8);
    GPIO_setOutputLowOnPin(GPIO_PORT_P6, GPIO_PIN0 | GPIO_PIN1 | GPIO_PIN2);

    GPIO_setAsOutputPin(   GPIO_PORT_P1, GPIO_PIN_ALL8);
    GPIO_setAsOutputPin(   GPIO_PORT_P2, GPIO_PIN_ALL8);
    GPIO_setAsOutputPin(   GPIO_PORT_P3, GPIO_PIN_ALL8);
    GPIO_setAsOutputPin(   GPIO_PORT_P4, GPIO_PIN_ALL8);
    GPIO_setAsOutputPin(   GPIO_PORT_P5, GPIO_PIN_ALL8);
    GPIO_setAsOutputPin(   GPIO_PORT_P6, GPIO_PIN0 | GPIO_PIN1 | GPIO_PIN2);

}

/*
 * Initialize the SPI peripheral on EUSCI A1
 */
void init_spi_peripheral()
{

        GPIO_setAsPeripheralModuleFunctionOutputPin(SPI_MOSI_PORT, SPI_MOSI_PIN, SPI_SELECT_FUNCTION);
        GPIO_setAsPeripheralModuleFunctionInputPin(SPI_MISO_PORT, SPI_MISO_PIN, SPI_SELECT_FUNCTION);
        GPIO_setAsPeripheralModuleFunctionOutputPin(SPI_CLK_PORT, SPI_CLK_PIN, SPI_SELECT_FUNCTION);


    //Initialize Master
        EUSCI_A_SPI_initMasterParam param = {0};
        param.selectClockSource = EUSCI_A_SPI_CLOCKSOURCE_SMCLK;
        param.clockSourceFrequency = CS_getSMCLK();
        param.desiredSpiClock = 1000000;
        param.msbFirst = UCMSB;
        param.clockPhase = EUSCI_A_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT;
        param.clockPolarity = EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_LOW;
        param.spiMode = EUSCI_A_SPI_3PIN;
        EUSCI_A_SPI_initMaster(EUSCI_A1_BASE, &param);

        EUSCI_A_SPI_enable(EUSCI_A1_BASE);

}

void init_wd_bms_uart(void)
{
    // Configure UART @38400 baud (EUSCI/16MHz)
    // http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430BaudRateConverter/index.html

    // Configure UCA0TXD and UCA0RXD
     GPIO_setAsPeripheralModuleFunctionOutputPin(UART_TXD_PORT, UART_TXD_PIN, UART_SELECT_FUNCTION);
     GPIO_setAsPeripheralModuleFunctionInputPin(UART_RXD_PORT, UART_RXD_PIN, UART_SELECT_FUNCTION);

     EUSCI_A_UART_initParam param = {
        .clockPrescalar = 26, .firstModReg = 0, .secondModReg = 214,
        .selectClockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK,
        .parity =            EUSCI_A_UART_NO_PARITY,
        .msborLsbFirst =     EUSCI_A_UART_LSB_FIRST,
        .numberofStopBits =  EUSCI_A_UART_ONE_STOP_BIT,
        .uartMode =          EUSCI_A_UART_MODE,
        .overSampling =      EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION
    };


    if(STATUS_FAIL == EUSCI_A_UART_init(EUSCI_A0_BASE, &param))
    {
        return;
    }

    EUSCI_A_UART_enable(EUSCI_A0_BASE);
}

/**
 * UART_Transmit_String()
 *  Prints a null terminated string on the UART
 * @param str null terminated string
  */
void UART_Transmit_String(const char *str)
{
    int i = 0;

    for(i = 0; i < UART_TRANSMIT_BUFFER_LENGTH; i++)
    {
        if (str[i] != '\0')
        {
            while (EUSCI_A_UART_queryStatusFlags(EUSCI_A0_BASE, EUSCI_A_UART_BUSY));
            EUSCI_A_UART_transmitData(EUSCI_A0_BASE, str[i]);
        }
         else
         {
             break;
         }
    }
}

void SetUpDCInitTransactions(spi_MaximTrans_t DCInit_transactions[]){
    //Enable keep alive mode
    DCInit_transactions[0].Len = 2;
    DCInit_transactions[0].Data[0] = 0x10;
    DCInit_transactions[0].Data[1] = 0x5;

    //Read Back Transaction byte
    DCInit_transactions[1].Len = 2;
    DCInit_transactions[1].Data[0] = 0x11;
    DCInit_transactions[1].Data[1] = 0x0;

    //Enable Rx Interrupt flags
    DCInit_transactions[2].Len = 2;
    DCInit_transactions[2].Data[0] = 0x4;
    DCInit_transactions[2].Data[1] = 0x89;
    //No Receive

    //Read Back Transaction byte
    DCInit_transactions[3].Len = 2;
    DCInit_transactions[3].Data[0] = 0x5;
    DCInit_transactions[3].Data[1] = 0x0;

    //Clear receive buffer
    DCInit_transactions[4].Len = 1;
    DCInit_transactions[4].Data[0] = 0xe0;
    //No Receive

    //Wakeup UART slave devices
    DCInit_transactions[5].Len = 2;
    DCInit_transactions[5].Data[0] = 0x0e;
    DCInit_transactions[5].Data[1] = 0x30;
    //No Receive

    //Read Back Transaction byte
    DCInit_transactions[6].Len = 2;
    DCInit_transactions[6].Data[0] = 0x0f;
    DCInit_transactions[6].Data[1] = 0x0;
    //No Receive
    //2ms delay for each slave to wake up

    //Wait for all UART slave devices to wake up
    DCInit_transactions[7].Len = 2;
    DCInit_transactions[7].Data[0] = 0x01;
    DCInit_transactions[7].Data[1] = 0x0;
    //Receive of 0x21 expected

    //End of UART slave device wake-up period
    DCInit_transactions[8].Len = 2;
    DCInit_transactions[8].Data[0] = 0x0e;
    DCInit_transactions[8].Data[1] = 0x10;

    //Read Back Transaction byte
    DCInit_transactions[9].Len = 2;
    DCInit_transactions[9].Data[0] = 0x0f;
    DCInit_transactions[9].Data[1] = 0x0;
    //No Receive
    //2ms delay for each slave to report null message

    //Wait for null message to be received
    DCInit_transactions[10].Len = 2;
    DCInit_transactions[10].Data[0] = 0x01;
    DCInit_transactions[10].Data[1] = 0x0;
    //Receive 0x10 or 0x12

    //Clear transmit buffer
    DCInit_transactions[11].Len = 1;
    DCInit_transactions[11].Data[0] = 0x20;
    //No Receive

    //Clear receive buffer
    DCInit_transactions[12].Len = 1;
    DCInit_transactions[12].Data[0] = 0xe0;
    //No Receive

    //Load the HELLOALL command sequence into the load queue
    DCInit_transactions[13].Len = 5;
    DCInit_transactions[13].Data[0] = 0xc0;
    DCInit_transactions[13].Data[1] = 0x03;    //message length
    DCInit_transactions[13].Data[2] = 0x57;    //HELLOALL command byte
    DCInit_transactions[13].Data[3] = 0x0;     //Register address (0x00)
    DCInit_transactions[13].Data[4] = 0x0;     //Initialization address of HELLOALL

    //Verify contents of the load queue
    DCInit_transactions[14].Len = 5;
    DCInit_transactions[14].Data[0] = 0xc1;
    DCInit_transactions[14].Data[1] = 0x0;
    DCInit_transactions[14].Data[2] = 0x0;
    DCInit_transactions[14].Data[3] = 0x0;
    DCInit_transactions[14].Data[4] = 0x0;

    //Transmit HELLOALL sequence
    DCInit_transactions[15].Len = 1;
    DCInit_transactions[15].Data[0] = 0xb0;
    //No Receive
    //2ms delay for each slave to respond

    //Poll RX_Stop_Status Bit
    DCInit_transactions[16].Len = 2;
    DCInit_transactions[16].Data[0] = 0x01;
    DCInit_transactions[16].Data[1] = 0x0;
    //Receive 0x12

    //Service receive buffer. Read the HELLOALL message that propagated through the daisy chain
    //and was returned back to the ASCI.The host should verify the device count
    DCInit_transactions[17].Len = 4;
    DCInit_transactions[17].Data[0] = 0x93;
    DCInit_transactions[17].Data[1] = 0x0;
    DCInit_transactions[17].Data[2] = 0x0;
    DCInit_transactions[17].Data[3] = 0x0;

    //Check for receive buffer errors
    DCInit_transactions[18].Len = 0x09;
    DCInit_transactions[18].Data[0] = 0x0;
}

SPI_Send(spi_MaximTrans_t Transmit[], uint8_t index){
    uint8_t SPI_TX_index = 0;            //byte count in transaction

    GPIO_setOutputLowOnPin(GPIO_PORT_P3, GPIO_PIN1);        //Maxim chip select low
    __delay_cycles(1000);                     //idle time between CS change
    for(SPI_TX_index = 0; SPI_TX_index < Transmit[index].Len; SPI_TX_index++){
       while(!(UCA1IFG & UCTXIFG));
       UCA1TXBUF = Transmit[index].Data[SPI_TX_index];
       while (!(UCA1IFG & UCRXIFG));
       RXData[SPI_TX_index] = UCA1RXBUF;
    }
    return;
}

/**
 * main.c
 */
int main(void)
{
    static uint8_t TXData = 0;           //transaction count

    static spi_MaximTrans_t DCInit_transactions[19];
    static spi_MaximTrans_t WriteAll_transactions[3];
    static spi_MaximTrans_t ReadAll_transactions[3];



    static uint8_t noReceive = 0;
    static uint8_t noInc = 0;

    char buf[76];

    WDTCTL = WDTPW | WDTHOLD;   // stop watchdog timer


    init_clock();
    init_gpio();                                    // Set up IO pins

    GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN1);       //SPI slave chip select


    // Set P1.0 to output direction
    GPIO_setAsOutputPin (GPIO_PORT_P1, GPIO_PIN0);
    GPIO_setAsInputPinWithPullUpResistor (GPIO_PORT_P4, GPIO_PIN2);
    GPIO_enableInterrupt (GPIO_PORT_P4, GPIO_PIN2);
    GPIO_selectInterruptEdge (GPIO_PORT_P4, GPIO_PIN2, GPIO_HIGH_TO_LOW_TRANSITION);
    GPIO_clearInterrupt (GPIO_PORT_P4, GPIO_PIN2);

    GPIO_setAsOutputPin (GPIO_PORT_P6, GPIO_PIN2);

    PMM_unlockLPM5();
    __enable_interrupt();

    SetUpDCInitTransactions(DCInit_transactions);
    TXData = 0x0;                             // Holds transaction number


    // Setup peripheral(s) now that gpio and clocks are setup
    init_spi_peripheral();                      // Init Maxim spi peripheral
    init_wd_bms_uart();

    GPIO_setOutputHighOnPin (GPIO_PORT_P6, GPIO_PIN2);              //SHDNL held high for 4ms to ensure all slaves are powered on
    __delay_cycles(32000);


    while (TXData < 19){
        noInc = 0;


        SPI_Send(DCInit_transactions, TXData);

        if ((TXData == 6) || (TXData == 9) || (TXData == 15))
            __delay_cycles(32000);    //wait for slaves to wake up

        if (TXData == 7){
            if (RXData[DCInit_transactions[7].Len-1] == 0x21){
               TXData++;
               noReceive = 0;
               noInc = 1;
               sprintf(buf, "Wake Up status 0x21 received\n\r");
               UART_Transmit_String(buf);
            }
            if (RXData[DCInit_transactions[7].Len-1] != 0x21){
               TXData = 7;
               noReceive++;
               if (noReceive == 3){
                   sprintf(buf, "Wakeup Error\n\r");      //Need to set a Fault
                   UART_Transmit_String(buf);
               }
            }
         }
         if (TXData == 10){
            if ((RXData[DCInit_transactions[10].Len-1] == 0x10) || (RXData[DCInit_transactions[10].Len-1] == 0x12)){
               TXData++;
               noReceive = 0;
               noInc = 1;
               sprintf(buf, "Wakeup Successful\n\r");
               UART_Transmit_String(buf);
            }
            else{
               TXData = 10;
               noReceive++;
               if (noReceive == 3){
                  sprintf(buf, "Wakeup Error: Preamble not received\n\r");      //Need to set a Fault
                  UART_Transmit_String(buf);
               }
            }
         }
         if (TXData == 16){
            if ((RXData[DCInit_transactions[16].Len-1] == 0x12)){
               TXData++;
               noReceive = 0;
               noInc = 1;
               sprintf(buf, "HELLOALL successful\n\r");
               UART_Transmit_String(buf);

            }
            else{
               TXData = 16;
               noReceive++;
               if (noReceive == 3){
                  sprintf(buf, "Wakeup Error: Preamble not received\n\r");      //Need to set a Fault
                  UART_Transmit_String(buf);
               }
            }
         }
         if ((noReceive == 0) && !noInc){
             TXData++;
         }

         if (TXData < 19){
             GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN1);        //Maxim chip select high
             __delay_cycles(1000);                                 //idle time between CS change
         }

     }

    GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN1);        //Maxim chip select high
         __delay_cycles(1000);                                 //idle time between CS change


    //Load WRITEALL sequence into the load queue
     WriteAll_transactions[0].Len = 7;
     WriteAll_transactions[0].Data[0] = 0xc0;      //WR_LD_Q_SPI command byte
     WriteAll_transactions[0].Data[1] = 5;
     WriteAll_transactions[0].Data[2] = 0x02;      //WRITEALL
     WriteAll_transactions[0].Data[3] = 0x12;      //ADDRESS
     WriteAll_transactions[0].Data[4] = 0xb1;
     WriteAll_transactions[0].Data[5] = 0xb2;
     WriteAll_transactions[0].Data[6] = 0Xc4;      //PEC byte
 //    WriteAll_transactions[0].Data[7] = 0x0;       //alive counter byte
     SPI_Send(WriteAll_transactions, 0);
     GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN1);        //Maxim chip select high
     __delay_cycles(1000);                                 //idle time between CS change


     //Start transmitting the WRITEALL sequence from the transmit queue
     WriteAll_transactions[1].Len = 1;
     WriteAll_transactions[1].Data[0] = 0xb0;   //WR_NXT_LD_Q_SPI command byte
     SPI_Send(WriteAll_transactions, 1);
     __delay_cycles(32000);

     GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN1);        //Maxim chip select high
     __delay_cycles(1000);                                 //idle time between CS change


     WriteAll_transactions[2].Len = 2;
     WriteAll_transactions[2].Data[0] = 0x01;   //Read RX_Status register
     WriteAll_transactions[2].Data[1] = 0x0;

     noReceive = 1;
     while ((noReceive > 0) && (noReceive < 3)){
        SPI_Send(WriteAll_transactions, 2);
        if (RXData[WriteAll_transactions[2].Len-1] == 0x12){
           sprintf(buf, "WRITEALL acknowledged\n\r");
           UART_Transmit_String(buf);
           noReceive = 0;
        }
        else{
           noReceive++;
           GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN1);     //Maxim chip select high
                __delay_cycles(1000);                                 //idle time between CS change
           if (noReceive == 3){
              sprintf(buf, "Writeall Error: not acknowledged\n\r");      //Need to set a Fault
              UART_Transmit_String(buf);
           }
        }
     }
     GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN1);     //Maxim chip select high
     __delay_cycles(1000);                                 //idle time between CS change

     ReadAll_transactions[0].Len = 7;
     ReadAll_transactions[0].Data[0] = 0x93;
     ReadAll_transactions[0].Data[1] = 0x0;
     ReadAll_transactions[0].Data[2] = 0x0;
     ReadAll_transactions[0].Data[3] = 0x0;
     ReadAll_transactions[0].Data[4] = 0x0;
     ReadAll_transactions[0].Data[5] = 0x0;
     ReadAll_transactions[0].Data[6] = 0x0;
     SPI_Send(ReadAll_transactions, 0);
     GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN1);     //Maxim chip select high
     __delay_cycles(1000);                                 //idle time between CS change


     ReadAll_transactions[1].Len = 2;
     ReadAll_transactions[1].Data[0] = 0x09;
     ReadAll_transactions[1].Data[1] = 0x0;
     SPI_Send(ReadAll_transactions, 0);
     GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN1);     //Maxim chip select high
     __delay_cycles(1000);                                 //idle time between CS change

}


//******************************************************************************
//
//This is the PORT2_VECTOR interrupt vector service routine
//
//******************************************************************************
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=PORT4_VECTOR
__interrupt
#elif defined(__GNUC__)
__attribute__((interrupt(PORT2_VECTOR)))
#endif
void P4_ISR (void)
{

    GPIO_clearInterrupt (GPIO_PORT_P4, GPIO_PIN2);
    // Toggle P1.0 output
    GPIO_toggleOutputOnPin (GPIO_PORT_P1, GPIO_PIN0);
    GPIO_setOutputHighOnPin(GPIO_PORT_P3, GPIO_PIN1);

}

  • As I read data sheet (Rev 3) p. 26, 0x11 in the Rx status register is {idle+empty} and 0x21 is {busy+empty}, so it sounds like it may be doing something.

    It looks like you're only trying to read the Rx status register twice. Did the "twice" come from somewhere?

    I ask since I think I saw that the UARTs (to the MAX17841 slave devices) run at 38.4kbps, or about 3840 bytes/sec. Sending 4 bytes would take (minimum) just over 1ms, and if they're sent sequentially to the two slaves that's 2+ms. Sending the read-status (2 bytes twice) would take 2x16usec, plus a delay (125usec?) after the first /CS, or maybe 160usec, quite a bit less than 2ms. (Yes, it would take longer than that, but still it's a big difference.)

    What happens if you bump your timeout from 3 to, say, 100?

  • As near as I can tell Table 11 describes the UART interface and not SPI. Table 9 is about SPI transactions.

  • Msp430 spi to max17841 spi. 

    Max17841 uart to max17853 uart daisy chain, currently I only have one max17853. 

    All commands to max 17853 originate from msp430.

    I will try the added transmissions shortly.

    Thanks 

  • Default baud rate of MAX17841 uart is 2Mbps. The MAX17853 auto detects the baud rate and can handle 2Mbps. Polling for status 100 times did not make a difference.

  • I'm way outside my competence here, but some thoughts:

    1) The final step of Table 10 prescribes reading the Rx_Interrupt_Flags register (after reading the data) and checking for errors. This is a bit unusual (typically this would be done before), but bit 7's corresponding bit in the Rx_Status register says it's only set when the byte is read from the Rx buffer. Anyway, you're reading that register but not checking it; I suppose it's possible there's leftover status getting in the way.

    2) You might try clearing the Tx and Rx buffers first [Ref Table 10 Transactions 8/9]. The GUI package doesn't include source code, so it's hard to be sure exactly what it's doing.

    3) You're omitting the Alive-Counter byte; I don't know whether that's significant, but I suggest you "follow the recipe" for now.

    4) I went back to your earlier post, which described the wiring, and it sounded like you were connecting Vaa on the MAX17853 to Launchpad 3.3V, which I expect is fine, but I'm less clear how you connect DCIN (on the MAX17853). Glancing at that data sheet, it seems to want 9V (min) on DCIN.

    5) I'm not quite clear what the 12B1B2 sequence is intended to do, since register 0x12 on the MAX17853 appears to be read-only. [Ref data sheet (19-100355; Rev 5) p. 207]

  • Thank you for your reply. I have a dedicated 18V power supply adapter for the MAX17853. The 3.3V from the LP powers the MAX17841. I am using the SPI decode function on the scope and save a history of the GUI commands. I have not made any discoveries yet. 

  • Hi Priya,

    Are you able to scope out what's being sent to and from each device?

    You mention those error commands, I'm curious if you can check the buffers the RX register to see what its filled with if it doesn't get properly cleared out. It does sound like there could be a potential timing issue because you're not receiving the same code, but it is either 0x11 or 0x21. Which I think Bruce mentioned earlier what they mean specifically. I'm not familiar with the MAX chips so I can't comment too much on that, but we can check the MSP to see if it is getting the correct command. 

    Regards,

    Luke

  • I have attached 3 scope pictures from the transactions for Table 11 (UArt write and read). The first write the message to the load queue (bytes xC0, x06, x02, x12, xb1, xb2, xc4, x00). Second picture shows polling for read status. Green is the MISO which is responding with 0x11. Third picture is verifying the write to the load queue which is empty. Why is nothing getting written to the load queue? During initialization (wakeup, helloall, Table 10), this same message was successful. I can post the initialization pictures that were successful if needed in another post.

  • You mentioned you had saved away traces from the GUI transactions. How do those (particularly the first) compare with these?

  • I have attached working versions of writing the load queue (0xC0) and reading after transmitting the hello all command (0xb0 followed by 0x93). They look identical to what I am doing for the UART write. Prior to UART write, I even added transactions to clear the transmit/receive buffers (repeat transactions 8 and 9 from Table 10) and followed up 0xC0 with a 0xC1 (read command to verify the write). After transmitting 0xb0, 0x93 still shows an empty queue. There is probably some hidden command that hasn't been documented in the Maxim datasheet I need to find.

  • scopeHistoryInit.xlsx

    Attached is the transaction sequence captured from the Maxim GUI using the scope history function with SPI decoding. I implemented this sequence as is. The results are still the same. The Maxim chips respond as expected to the daisy chain initialization sequence from Table 10. But the UART write halts at the same point. I write to the load queue and transmit the sequence. Then I try to read the receive buffer but it is empty, it has no writeall message. The GUI is able to write and read from the UART OK, but with the MSP 430 this is not happening. I need some insight as to why. Thanks

  • (I suppose I should read this in Frame Number order, i.e. bottom to top?)

    Notable by its absence is the status-polling (0x01) recommended in (e.g.) Table 11 Transaction 3 -- it seems to be assuming that the response has arrived by the time it looks. (Since all the interrupts (0x04) were disabled in frame 9, It wouldn't be able to use the /INT wire.) I wonder if the GUI is just relying a delay or something?

    When you duplicated this sequence (I suppose you left out the status polling as well), what did you get back from the 0x93 (frames 13,16,19,22)?

    ----------------

    At some point you'll have to take this to Maxim, since I haven't noticed any max17841 wizards speaking up here. Sending the same sequence as the GUI but getting different results seems like a reasonable case to present.

    Last I looked ADI hadn't adopted Maxim into its Forum (EngineerZone), but there's a tech support link from the Maxim home page.

  • I look a closer look at the GUI transaction implementation, for the responses to 0x93 using the MSP430, I put in correct transaction lengths.  I have captured successful scope traces of MISO responses! Yes, maxim support has been contacted and this is where I am with the issue so far. I appreciate the help here, Thanks

  • Let us know how it turns out.

**Attention** This is a public forum