Hi, I have an application for 56F827 processor, in which I am using Quad timer in PWM mode. On and off time for PWM mode of Quad timer will change according to the input (Dynamically). I have initialized quad timer as follows:- ************************************************************************ ************************** qt_sState quadParam1 = { /* Mode = */ qtVariableFreqPWM, /* InputSource = */ qtPrescalerDiv64, /* InputPolarity = */ qtNormal, /* SecondaryInputSource = */ 0, /* CountFrequency = */ qtRepeatedly, /* CountLength = */ qtUntilCompare, /* CountDirection = */ qtUp, /* OutputMode = */ qtToggleUsingAlternateCompare, #ifdef ACTIVE_LOW /* OutputPolarity = */ qtInverted,//qtNormal, #else /* OutputPolarity = */ qtNormal, #endif /* OutputDisabled = */ 0, /* Master = */ 0, /* OutputOnMaster = */ 0, /* CoChannelInitialize = */ 0, /* AssertWhenForced = */ 0, /* CaptureMode = */ qtDisabled, /* CompareValue1 = */ 0x000f, // Off Time /* CompareValue2 = */ 0xf414, // On Time /* InitialLoadValue = */ 0x0000, /* CallbackOnCompare = */ { CallbackOnCompare1, 0 }, /* CallbackOnOverflow = */ { 0, 0 }, /* CallbackOnInputEdge = */ { 0, 0 }, 0, //ComparatorValue2; 0, //ComparatorValue1; 0,//qtEnableCompareInterrupt, //InterruptEnable2 : 1; 0,//qtDisableCompareInterrupt, //InterruptEnable1 : 1; qtLoadOnCompare2, //LoadControl2 : 2; qtLoadOnCompare1 //LoadControl1 : 2; }; ************************************************************************ ************************** But ComparatorValue2 & ComparatorValue1 values are 0, assigning them after getting the input. I am writing those values by using following funcion qtIoctl (TimerQ1, QT_LOAD_COMPARATOR_LOAD_REG1, Main_Off_Cnt, BSP_DEVICE_NAME_QUAD_TIMER_A_0); qtIoctl (TimerQ1, QT_LOAD_COMPARATOR_LOAD_REG2, Main_On_Cnt, BSP_DEVICE_NAME_QUAD_TIMER_A_0); Though I have intialized timer such that new values of on and off time will be loaded into the registers and will be effective from that instant I can't see expected change on the timer output. Am I missing any initialization? Regards, Nitin **************************Disclaimer************************************ Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *************************************************************************** |
Reloading of on off time for quad timer for PWM mode.
Started by ●January 28, 2003