[ARM] SPI comunication L9958(Low RDSON SPI controlled H-Bridge) with LPC2103 controller

Status
Not open for further replies.

KVSN91

Junior Member level 2
Joined
Aug 27, 2015
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
182
hi,
i am controlling a dc motor using L9958 with LPC2103 controller. I am new to ARM.

L9958 is SPI communication based IC. To control my Device to set some registers in L9958. I can't understood how to set those bits.the registers are Configuration register and Diagnosis register.

configuration register
diagnosis register
how to set these registers through SPI
please help me


thanks and regards
kvsn91
 
Last edited by a moderator:

Hi,

datasheet is your friend.
Chapter 3.3 SPI interface.

As described:
* set CS = low
* transmit 16 bits (2 bytes) of CFG_REG --> the same time you recieve 16 bits of DIA_REG.
* set CS =high

Klaus
 

Thank u Klaus sir,


i wrote like this '
Code:
   write_L9958 (unsigned int Value)
   {
     CS =0;
     SPI_TX_RX (0x08);   //LSB
     SPI_TX_RX (0x00);   // MSB
     CS = 1;
   }

Here i set Diagnosis reset (DR) bit to '0'. All diagnosis bits reset at each spi reading.
and set CL_1 & CL_2 bits to CL_1 =0, CL_2=1 (Default Value 6.6A)for regulation current levels.
And VRS & IRS set to '0' (Default as per datasheet).

i have doubt only it is correct or wrong.. is there any mistake tell.


thanks and regards
kvsn91
 
Last edited by a moderator:

Hi,

your setup seems OK.

Confusing in datasheet is the numbering of CL bits. Sometimes thas say 1 and 2, sometimes 0 and 1

Klaus
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…