移植MC68HC908QT4程序到 MC9S08QD4中遇到问题
- UID
- 798133
- 性别
- 男
|
移植MC68HC908QT4程序到 MC9S08QD4中遇到问题
移植MC68HC908QT4程序到 MC9S08QD4,但是PWM设置中,908QT4的功能位TSC0_CH0MAX 置0、1,QD4没有这个对应的位,如何解决,请高手一下。 |
|
|
|
|
|
- UID
- 798133
- 性别
- 男
|
#if PWM_POLARITY == PWM_NEG /* negative PWM polarity */
if (AppControl.B.FullOpen == 1) /* PWM fully open, duty cycle set to 0% */
{
if (AppControl.B.ZeroDuty == 0)
{
AppControl.B.ZeroDuty = 1; /* zero duty cycle on */
TSC0_CH0MAX=0; // MC9S08QD4 TPMC0V = 0; use MIN20 ?
}
}
else
{
if (AppControl.B.ZeroDuty == 1)
{
AppControl.B.ZeroDuty = 0; /* zero duty cycle off */
TSC0_CH0MAX=1;// MC9S08QD4 TPMC0V = 220; use MAX 200 ?
}
}
#else /* positive PWM polarity */
if (AppControl.B.FullOpen == 1) /* PWM fully open, duty cycle set to 100% */
{
if (AppControl.B.MaxDuty == 0)
{
AppControl.B.MaxDuty = 1; /* Max duty cycle on */
TSC0_CH0MAX=0;
}
}
else
{
if (AppControl.B.MaxDuty == 1)
{
AppControl.B.MaxDuty = 0; /* Max duty cycle off */
TSC0_CH0MAX=1;
}
}
#endif |
|
|
|
|
|