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] [November 2004 Threads] TimerTick on PIC18 portPosted by Marcel van Lieshout on November 26, 2004 Studying the PIC18-port I came across the following line in port.c:
OpenTimer1( T1_16BIT_RW & T1_SOURCE_INT & T1_PS_1_1 & T1_CCP1_T3_CCP2 );
Reading "MPLAB_C18_Libraries_51297c.pdf" on www.microchip.com to figure out what this function does, confuses me. The argument "T1_CCP1_T3_CCP2" is not defined for OpenTimer1, it's only defined for OpenTimer3. Can someone enlighten me on this?
Marcel
RE: TimerTick on PIC18 portPosted by Nobody/Anonymous on November 26, 2004 The C18 header file does not define T1_CCP1_T3_CCP2 for all devices. Maybe the library documentatin does not take this into account.
#if defined(__18F6520) || defined(__18F6620) || defined(__18F6720) || \ defined(__18F8520) || defined(__18F8620) || defined(__18F8720) || \ defined(__18F6620) || defined(__18F6621) || \ defined(__18F8620) || defined(__18F8621)
#define T34_SOURCE_CCP 0b11111111 #define T12_CCP12_T34_CCP3450b11110111 #define T12_CCP1_T34_CCP23450b10111111 #define T12_SOURCE_CCP 0b10110111
#else
#define T3_SOURCE_CCP 0b11111111 #define T1_CCP1_T3_CCP2 0b10111111 #define T1_SOURCE_CCP 0b10110111
#endif
RE: TimerTick on PIC18 portPosted by Nobody/Anonymous on November 26, 2004 My library ref manual (dated 2003) has the CCP section missing for timer 1.
The code example is given as:
OpenTimer1( TIMER_INT_ON & T1_8BIT_RW & T1_SOURCE_EXT & T1_PS_1_1 & T1_OSC1EN_OFF & T1_SYNC_EXT_OFF & T1_SOURCE_CCP );
But it does not define the T1_SOURCE_CCP options for timer 1.
Compare this to timer 3 where the code snippet is almost the same (T1->T3) but just above it there is a section "Use With CCP:" that defines values for T3_SOURCE_CCP.
Looks to me just like an omission from the manual.
RE: TimerTick on PIC18 portPosted by Marcel van Lieshout on November 27, 2004 The weird thing then is that the datasheet (eg. 18F452) also defines it only for timer3...
RE: TimerTick on PIC18 portPosted by Richard on November 27, 2004 Hi Marcel,
This does look odd looking back. I got the constant value from the header file - and presuming that the timer is working correctly and that the header file is not incorrect - it seems ok.
I need to investigate futher and see exactly what the timer function library call does and compare this to the datasheet.
Regards.
RE: TimerTick on PIC18 portPosted by Marcel van Lieshout on November 27, 2004 Well, I assume it works. So, your call should be correct. I was just wondering, nothing more. It's of course ok If you like to investigate this, but my quriosity (?) is already satisfied :-)
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|