1. Attachments are working again! Check out this thread for more details and to report any other bugs.

4 Wire SPI bus to AC Compressor

Discussion in 'Gen 3 Prius Technical Discussion' started by jchen4, Jun 28, 2011.

  1. jchen4

    jchen4 New Member

    Joined:
    Jun 28, 2011
    3
    0
    0
    Location:
    San Diego California
    Vehicle:
    Other Non-Hybrid
    Model:
    N/A
    I'm trying to run the AC Compressor as a stand alone air conditioner and I would like to know what protocol to use to drive the 4 wire Serial Peripheral Interface (SPI) controlling the built in compressor inverter. The Power Management Module acts as the master and the inverter acts as the slave, receiving the command for the compressor RPM. The maintenance manual suggests this bus runs at 12 volts DC. Does the CAN bus also run at 12 VDC? Thanks for any help I can get.
     
  2. rrolff

    rrolff Prius Surgeon

    Joined:
    Aug 19, 2009
    1,610
    246
    0
    Location:
    So Cal
    Vehicle:
    2010 Prius
    Model:
    III
    Good luck - no one outside Toyota is going to have that off hand...

    I'd guess it's running on one of the 2 wire CAN buses - connected to a HVAC controller (pins available on PBD connector). You'd need to figure which CAN bus, which pins, baud rate, then monitor and reverse engineer...
     
    1 person likes this.
  3. kbeck

    kbeck Active Member

    Joined:
    Feb 10, 2010
    420
    274
    0
    Location:
    Metuchen, NJ
    Vehicle:
    2010 Prius
    Model:
    III
    Interesting. I don't know if the SPI acronym you're using here is the same one that I run into on a normal day, but I suppose it's possible.

    Standard SPI buses are four wire: Select lead, clock (from master), transmit data (from master), and receive data (from slave). If this is the bus I muck with daily, it's dead stupid: Drive the select lead low. Fill a 8-bit wide FIFO with transmit data, then start the clock. Clock and data go out serially to the slave, which has been primed to receive by the select lead. As data goes out to slave, data is clocked serially into the master. Every eight bits puts a byte into the receive 8-bit wide FIFO, and all this continues until the transmit FIFO is empty and the last 8 bits have been transmitted. At that point the clock stops, the master raises the Select lead high, and that's that.

    Unlike other buses one might run into (I2C, microprocessor buses with ACK/DTACK, etc.) there's no handshaking built into the protocol. Most slave devices I've run into echo back the TX data, thus providing the Master some kind of indication that Something Is Listening Out There, but that's up to the peripheral designer and their data sheet.

    Interestingly, the protocol doesn't support, or maybe a better way to say it, doesn't care, about the amount of data to be transferred. Suppose that the Peripheral Of The Day needs to transmit 20 bytes of data after some command from the Master; in that case, the Master had to know ahead of time (or maybe with some data transmitted by the Slave) that there's 20 bytes to come. In that case the Master has to send 20 dummy bytes of data to keep the SPI clock going so the Slave can shift out its 20 bytes of data to the Master.

    The basic idea behind the bus is simple: So long as clock is going data is being clocked into the Slave and is also being clocked into the Master. What the two of them do with the data gets interesting: The Master and Slave could implement CRC, or parity, of some funny kind of handshaking and variable length data, or whatever - and you'd need data sheets to figure out what's going on where. Heck, the data could even be encrypted, if one liked!

    One nice thing about the bus: Unlike I2C and the like all the signals on the bus are driven both high and low. This makes them somewhat immune to electronic noise. The SPI buses I've seen run at 5V and 3.3V, but I suppose there's no reason it couldn't be running at 12 or some such.

    KBeck
     
  4. Slociviccoupe

    Slociviccoupe New Member

    Joined:
    May 21, 2019
    2
    0
    0
    Location:
    32950
    Vehicle:
    Other Hybrid
    Model:
    N/A
    Im after same info. Either second gen ac inverter in the underside of the main inverter, or the built in inverter on top the ac compressor. A pin out would be helpfull and any info on what data turns compressor on and off and data for 3 compressor speeds.

    I am also doing prius compressor retrofit into another hybrid (honda insight) . I just want to run the compressor and none of the other associated ac controls from the prius. With maybe exception of the ac inverter.

    If not possible then looking for suitable controller that will run the compressor. I know its a sensorless 3 phase ipm brushless motor and takes 200vdc to run it. Other than that is all i know.