Hi guys,

I've started working on the issues with the PWM libraries. So you may 
all proceed with your own Jallib activities....

Please help me with understanding the following:

1. in pwm_ccp1.jal

> procedure pwm1_set_dutycycle(byte in duty) is
>    ccpr1l_shadow = duty
>    CCPR1L  = ccpr1l_shadow   -- reload 8 high order bits of dutycycle
>    CCP1CON = ccp1con_shadow  -- reload 2 low  order bits of dutycycle
> end procedure

When setting low resolution mode I think the 2 low order bits of the 10 
for the duty cycle should be explicitly set to '00'.  True or false?

2. Setting PWM in high resolution mode activates PWM, same with 
percent_dutycycle. Why not when setting PWM in low resolution mode? 
Seems more consistent to let these procedures all active PWM.

3. in pwm_ccp1.jal

> procedure pwm1_off() is
>    -- pwm mode off, but keep 2 LSbits values
>    ccp1con_shadow = ccp1con_shadow & !0b_0000_1100
>    CCP1CON = ccp1con_shadow
> end procedure

This leaves the CCP module in some Capture/Compare mode state (bits 0 
and 1 could be any value). I assume it is very unlikely that someone 
'hot' switches the CCP module alternately for PWM and Capture/Compare 
mode.  Therefore I think it would be better to switch off the whole CCP 
module with:
    ccp1con_shadow = ccp1con_shadow & !0b_0000_1111


Thanks in advance for your insights.

Regards, Rob.


-- 
Rob Hamerling, Vianen, NL (http://www.robh.nl/)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to