28.2.154 __builtin_write_PWMSFR

Architecture

dsPIC33C/E/F, dsPIC30

Description

Writes the PWM unlock sequence to the SFR pointed to by PWM_KEY and then writes value to the SFR pointed to by PWM_sfr

Prototype

void __builtin_write_PWMSFR(volatile uint16_t *PWM_sfr, 
 uint16_t value, volatile uint16_t *PWM_KEY); 

Arguments

PWM_sfr – register to be written

value – value to write

PWM_KEY – hardware unlock key location

Return Value

None

Example Instruction Sequence

mov   #PWM_KEY, w3
mov   #value, w2
mov   #0x4321, w1
mov   #0xABCD, w0
mov   w1,[w3]
mov   w0,[w3]
mov   w2,[w3]

Error Messages

None

Examples

Example 1:

__builtin_write_PWMSFR(&PWM1CON1, 0x123, &PWM1KEY);

Example 2:

__builtin_write_PWMSFR(&P1FLTACON, 0x123, &PWMKEY);

The choice of PWM_KEY may depend upon architecture.