Go Down

Topic: Mega2560 OCR register equivalent on the Due? (Read 491 times) previous topic - next topic

rhys79

Working on updating a piece of code to work on the Due.  It uses a header file called fastio.h.  The file has #define statements for lots of pin information.  I've been digging through the datasheets all afternoon and am not finding what I'm looking for.  Is there an equivalent to the Output Compare Registers on the Sam3x8e for setting up PWM on digital output pins, and if so, what is it?  IE: DIO2 on the Mega2560 uses OCR3BL to enable PWM.

Hopefully someone can help me out, or at least tell me if and why I'm barking up the wrong tree :~

Code snippets for reference:

Mega2560
Code: [Select]

#define OC3B DIO2
#define DIO2_PIN PINE4
#define DIO2_RPORT PINE
#define DIO2_WPORT PORTE
#define DIO2_DDR DDRE
#define DIO2_PWM &OCR3BL


Sam3X8E
Code: [Select]

#define TIOA0 DIO2
#define DIO2_PIN PINA9
#define DIO2_RPORT PINA
#define DIO2_WPORT PORTA
#define DIO2_DDR DDRA
#define DIO2_PWM ?????????????


Thank you!

Go Up