[AVR] Timer 1 Tick Interrupt FreeRTOS ATMEGA16

Status
Not open for further replies.

febrijonathansirait

Newbie level 1
Joined
Nov 22, 2016
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
10
hi guys. do i need to change these line of code if i want to use FreeRTOS in ATMega16. by default these code is used in FreeRTOS ATMega128 and ATMega64. i got the code from FreeRTOS ATMega128 CodevisionAVR example (), and the code is located in FreeRTOSV5.2.0\Source\portable\CodeVisionAVR\AVR\port.c


Code:
/* Hardware constants for Timer1. */
#if (defined _CHIP_ATMEGA128_) | (defined _CHIP_ATMEGA64_)

/* ATmega64, ATmega128 chips, Timer 1 runs in Mode 4 */
#define portCLEAR_COUNTER_ON_MATCH ( ( unsigned portCHAR ) 0x08 ) // WGM13=0 WGM12=1
#define portPRESCALE_64	( ( unsigned portCHAR ) 0x03 )
#define portCLOCK_PRESCALER ( ( unsigned portLONG ) 64 )
#define portCOMPARE_MATCH_A_INTERRUPT_ENABLE ( ( unsigned portCHAR ) 0x10 )

#else
#error please modify Timer1 hardware constants  to suit your chip
#endif

 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…