Skip to content

feat(PeriphDrivers): IPO Calibration Support (CFSIO-5118) - #1567

Open
dnguye14-adi wants to merge 2 commits into
analogdevicesinc:mainfrom
dnguye14-adi:feat/IPO-Calibration-Support
Open

feat(PeriphDrivers): IPO Calibration Support (CFSIO-5118)#1567
dnguye14-adi wants to merge 2 commits into
analogdevicesinc:mainfrom
dnguye14-adi:feat/IPO-Calibration-Support

Conversation

@dnguye14-adi

Copy link
Copy Markdown
Contributor

Add Function for System Calibration Clock.

Add IPO Calibration Examples

Checklist Before Requesting Review

  • PR Title follows correct guidelines.
  • Description of changes and all other relevant information.
  • (Optional) Link any related GitHub issues using a keyword
  • (Optional) Provide info on any relevant functional testing/validation. For API changes or significant features, this is not optional.

Add Function for System Calibration Clock.

Add IPO Calibraion Examples

Signed-off-by: dnguye14-adi <dung.nguyen@analog.com>
@github-actions github-actions Bot added MAX32670 Related to the MAX32670 (ME15) MAX32672 Related to the MAX32672 (ME21) MAX32675 Related to the MAX32675 (ME16) MAX32690 Related to the MAX32690 (ME18) MAX32662 Related to the MAX32662 (ME12) MAX32657 Related to the MAX32655 (ME30) labels Jun 2, 2026
Comment thread Examples/MAX32690/IPO_CALIB/main.c
Signed-off-by: dnguye14-adi <dung.nguyen@analog.com>
MXC_SETFIELD(MXC_FCR->autocal1, MXC_F_FCR_AUTOCAL1_INITIAL,
0x100 << MXC_F_FCR_AUTOCAL1_INITIAL_POS);
MXC_SETFIELD(MXC_FCR->autocal0, MXC_F_FCR_AUTOCAL0_GAIN, 4 << MXC_F_FCR_AUTOCAL0_GAIN_POS);
MXC_FCR->autocal0 |= 0x7;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MXC_FCR->autocal0 |= 0x7;
MXC_FCR->autocal0 |= MXC_F_FCR_AUTOCAL0_SEL | MXC_F_FCR_AUTOCAL0_EN | MXC_F_FCR_AUTOCAL0_LOAD;

// MXC_FCR->autocal0.sel is set to 1

MXC_FCR->autocal0 &= ~MXC_F_FCR_AUTOCAL0_EN; // Stop the calibration
MXC_FCR->autocal0 |= MXC_F_FCR_AUTOCAL0_SEL; // Enable use of calibration value

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary? It's already set with MXC_FCR->autocal0 |= 0x7; line.

MXC_SETFIELD(MXC_FCR->autocal1, MXC_F_FCR_AUTOCAL1_INITIAL,
0x100 << MXC_F_FCR_AUTOCAL1_INITIAL_POS);
MXC_SETFIELD(MXC_FCR->autocal0, MXC_F_FCR_AUTOCAL0_GAIN, 4 << MXC_F_FCR_AUTOCAL0_GAIN_POS);
MXC_FCR->autocal0 |= 0x7;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same above.

// MXC_FCR->autocal0.sel is set to 1

MXC_FCR->autocal0 &= ~MXC_F_FCR_AUTOCAL0_EN; // Stop the calibration
MXC_FCR->autocal0 |= MXC_F_FCR_AUTOCAL0_SEL; // Enable use of calibration value

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same above?

}

int err = E_NO_ERROR;
// The following section implements section 4.2.2.1 of the MAX32670 UG Rev 4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should refer to MAX32672 UG instead of MAX32670 UG, but I couldn't find a calibration section for IPO in MAX32672 UG..

if ((err = MXC_SYS_ClockSourceEnable(MXC_SYS_CLOCK_ERTCO)))
return err;

//MXC_Delay(MXC_DELAY_MSEC(10));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

if ((err = MXC_SYS_ClockSourceEnable(MXC_SYS_CLOCK_ERTCO)))
return err;

//MXC_Delay(MXC_DELAY_MSEC(10));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this file.

/**
* @file main.c
* @brief IPO Calibration example
* @details PWM Timers - Outputs a PWM signal (2Hz) on LED0 - ERTCO Clock and P0.1 - IPO_APB Clock

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update @details part of all added examples according to their context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MAX32657 Related to the MAX32655 (ME30) MAX32662 Related to the MAX32662 (ME12) MAX32670 Related to the MAX32670 (ME15) MAX32672 Related to the MAX32672 (ME21) MAX32675 Related to the MAX32675 (ME16) MAX32690 Related to the MAX32690 (ME18)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants