Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[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
Bit Name

0 - LSB RES
1 DR
2 CL_1
3 CL_2
4 RES
5 RES
6 RES
7 RES
8 VSR
9 ISR
10 ISR_DIS
11 OL_ON
12 RES
13 RES
14 0
15-MSB 0
diagnosis register
0 LSB OL_OFF
1 OL_ON
2 VS_UV
3 VDD_OV
4 ILIM
5 TWARN
6 TSD
7 ACT
8 OC_LS1
9 OC_LS2
10 OC_HS1
11 OC_HS2
12 Null
13 Null
14 SGND_OFF
15 MSB SBAT_OFF
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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top