Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[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

Untitled.png
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top