(uint8_t) ((PORTC >> 4) & 0x07)
is used since all
Hall pins are located in the PORTC register. The DMA source address that will be set is
based on the currentSector0
. Using the SetDMA()
subroutine, the source addresses of each DMA channel is pointed to a different set of
sinusoidal data, depending on the detected location. Each PWM module is configured with
an individual transfer, utilizing three DMA channels. The DMASELECT register should be
set before configuring an individual channel. Figure 6-4 shows the
CheckSector()
subroutine that is used in Hall ISR to configure the
DMA channels.Hall B is also used to identify the reference speed for the motor angular position. Each time a Hall B positive edge transition is detected, the value of the TMR3 period is copied to the CCP compare value and reloads all timers used in motor angular position.