Other Parts Discussed in Thread: PMP8740
Dear Roberto,
Good Morning. How are you? Questions regarding PMP8740 - Battery Charger(34V, 60A) --> Software Code related.
Q1) Regarding Minimum Current Trickle Parameter - Settable range 2 to 20. state status_charger - from 5 to 6.
When I set Minimum Current Trickle to minimum 2 --> counter from 0 to 10 reach in 100 ms. After check Voltage Output <10 or not? If yes, Current PWM out
as per counter_status = 10 --> TACCR1 = 15467 --> ON Time More. If not, counter_status from 10 to 300(counter_max) reach in 2900ms, means DC/DC regulating the programmed current, correct?
When I set Minimum Current Trickle to Maximum 20 --> counter from 0 to 100 reach in 1000 ms. After check Voltage Output<10 or not? If not then Current PWM out
as per couter_status = 100 --> TACCR1 = 10667 --> ON Time Less. If not, counter_status from 100 to 300(counter_max) reach in 2000ms, means DC/DC regulating the programmed current, correct?
Actually what is use of Minimum Current Trickle Parameter(from state 5 to 6)? Please explain if you remember this loop? If not, tell me use of Min. current trickle in general battery charger..
Q2) Regarding pushbuttons logic - Can you explain following pushbuttons code logic?
i = key_state ^ SWITCH_PIN; // key changed?
i = i & BIT_MASK; // throw away other bits
key_state = key_state & BIT_MASK; // throw away other bits
ct0 = ~( ct0 & i ); // reset or count ct0
ct0 = ct0 & BIT_MASK; // throw away other bits
ct1 = ct0 ^ (ct1 & i); // reset or count ct1
ct1 = ct1 & BIT_MASK; // throw away other bits
i &= ct0 & ct1; // count until roll over ?
key_state ^= i; // then toggle debounced state
key_press |= key_state & i; // 1->0: key press detect
if( (key_state != BIT_MASK) && !(rpt_active)) // check repeat function
{
rpt_state = ~key_state; // save key status
rpt_state = rpt_state & BIT_MASK; // throw away other bits
rpt = REPEAT_START; // start delay
rpt_active = 1;
}
if(rpt_active) rpt--;
if( (rpt == 0) && rpt_active)
{
key_rpt = rpt_state & (~key_state); // check if the key is still pressed
key_rpt = key_rpt & BIT_MASK; // throw away other bits
rpt_active = 0; // reset flag
}
Q3) Regarding CAN comummunication - in Micro-controller not inbuilt CAN therefore use UART & convert to CAN (using external hardware - CAN IC).
In software code use this UART protocol for testing purpose, not standard CAN protocol, am I correct?
can I use CAN J1939 Protocol insert this protocol? or different timing for CAN protocol...Please help.
Thanks & Regards,
Vijay Shinde