Other Parts Discussed in Thread: HALCOGEN
Tool/software: Code Composer Studio
Hello,
on a board designed in-house, I am trying to access the TPS65381 via SPI4 (4-wire mode), but SPI4_NCS[0], Pin 24 (PGE), keeps high (2.3 V at VDD_IO = 3.3 V).
My init code designed after studying the TRM yields the following register settings (as reported via the XDS100v2 debug probe, with annotations regarding deviations from an init function generated by HALCoGen):
GlbCtrl0 0x00000001 Global control register 0
GlbCtrl1 0x01000003 Global control register 1
Int0 0x00000000 Interrupt Register
IntLvl 0x00000000 Interrupt Level Register
IntFlg 0x01000200 Flag Register
Fun 0x01010E01 Pin Control 0
Dir 0x00000000 Pin Control 1 (HALCoGen deviates, 0x00010601, IMHO ignored for functional pins)
DIn 0x00000001 Pin Control 2
DOut 0x00000000 Pin Control 3 (HALCoGen deviates, 0x00000001)
DSet 0x00000000 Pin Control 4 (HALCoGen deviates, 0x00000001)
DClr 0x00000000 Pin Control 5 (HALCoGen deviates, 0x00000001)
PDr 0x00000000 Pin Control 6
PDis 0x00010601 Pin Control 7 (relevant compare Charles' answer elsewhere last para)
PSel 0x01010F01 Pin Control 8
TxDat0 0x0000A300 Transmit Data Register 0
TxDat1 0x0400A300 Transmit Data Register 1 (this is after trying to read a TPS65381 register, note WDEL = 1 and CS[0] = 0
RxBuf 0x80000000 Receive Buffer Register
Emu 0x80000000 Emulation Register
Delay 0x0405FFFF Delay Register (HALCoGen deviates, 0x04050000, irrelevant)
DefCs 0x00000001 Default Chip select Register
DatFmt0 0x55002B10 Data Format Register 0
I reduced the code after init() to this loop:
while (1) {
spiREG4->DAT1 = 0x04FEA300; // 4 is WDEL, FE is CS_0, A3 is to read TPS register SAFETY_STAT_3
while (!(spiREG4->FLG & 1<<8)) ; // TRM 28.8.1, 28.9.5
uint16 tmp = spiREG4->BUF ); // (TPS65381 5.5.3.5)
}
Any ideas where to look?