FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [January 2007 Threads] PWM CONFIGURATIONPosted by Nobody/Anonymous on January 21, 2007 HI!!
Can you help us please with the following problem:
We made a PWM configuration (PIC18f452) to drive two motors using the CCP1CON and CCP2CON registers. It is the program code:
void Configuracion_PWM(void) { PR2=0xFF; CCP1CONbits.DC1B1=DUTY_PWM1bits.BIT1; CCP1CONbits.DC1B0=DUTY_PWM1bits.BIT0; CCPR1L=DUTY_PWM1>>2; // Config. duty cicle (MSB) PWM1 CCP2CONbits.DC2B1=DUTY_PWM2bits.BIT1; CCP2CONbits.DC2B0=DUTY_PWM2bits.BIT0; CCPR2L=DUTY_PWM2>>2; // Config. duty cicle (MSB) PWM2 TRISCbits.TRISC2=0; TRISCbits.TRISC1=0; TRISBbits.TRISB4=0; TRISBbits.TRISB5=0; T2CONbits.TMR2ON=1; T2CONbits.T2CKPS1=1; T2CONbits.T2CKPS0=1; CCP1CONbits.CCP1M3=1; CCP1CONbits.CCP1M2=1; CCP1CONbits.CCP1M1=0; CCP1CONbits.CCP1M0=0; CCP2CONbits.CCP2M3=1; CCP2CONbits.CCP2M2=1; CCP2CONbits.CCP2M1=0; CCP2CONbits.CCP2M0=0; }
This program works very well, but we have to put it into the FREERTOS, so the problem is that both of them are using the same register CCPCON1.
Thanks so much for your help. We´ll waiting your best answer.
Best Regards,
Moneditas
RE: PWM CONFIGURATIONPosted by Nobody/Anonymous on January 22, 2007 You can generate the tick interrupt from any peripheral that can generated a fix period interrupt. I'm not familiar with the PIC, but other processors I have used have been able to generate the tick from the watchdog timer. Look at the function prvSetupTimerInterrupt() in port.c for the PIC18 port. This is where the timer interrupt is configured. You can change it as required.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|