TLE7242 Updating Current Value Problem

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User18455
Level 1
Level 1
Hi,

I'm using to TLE7242 for selenoid control. I am sending variable current value over SPI line to TLE in infinite loop. But, PWM output signals is distorted such as frequency value change or output signal loss. I'm using only channel 0 and channel 1 for pwm conntoller. I'm using 0.05 ohm for sense resistor. Could you please explain to me, why i can't update continuously the current value ?

My code example like below (its not last version or full code only for explained my problem. It's not include the other function like init etc):


setCurrent(int ch, int current){
char txData[4] = {0x8c,0x80,0xf8,0x00};
txData[0] |= ch;
txData[3] = current;
send_spi(txData);
}
while(1){
setCurrent(Channel_0, count);
setCurrent(Channel_1,count++)
delayMs(100);
if(count == 256){
count=0;
}
}
0 Likes
0 Replies