1 / 10

Programmable Counter Array PCA

Programmable Counter Array PCA. Programmable Counter Array: PCA0. Clock sources: SYSCLK Internal oscillator: SYSCLK: F PCA = 2MHz SYSCLK/4 : F PCA = 500 KHz SYSCLK/12 : F PCA = 167 KHz SYSCLK External oscillator: SYSCLK : F PCA = 22.1184 MHz SYSCLK/4 : F PCA = 5.5296 MHz

ipo
Download Presentation

Programmable Counter Array PCA

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programmable Counter Array PCA EE/CS-352: Embedded Microcontrollers Systems

  2. Programmable Counter Array: PCA0 • Clock sources: • SYSCLK Internal oscillator: • SYSCLK: FPCA= 2MHz • SYSCLK/4 : FPCA = 500 KHz • SYSCLK/12 : FPCA = 167 KHz • SYSCLK External oscillator: • SYSCLK : FPCA = 22.1184 MHz • SYSCLK/4 : FPCA = 5.5296 MHz • SYSCLK/12 : FPCA = 1.8432 MHz • Timer 0 Overflow: • Slowest: internal oscillator/12 * FFFF : FPCA = 2.55 Hz • Custom: ECI (External Clock Interface) • max FPCA rate is SYSCLK/4. Fastest Slowest EE/CS-352: Embedded Microcontrollers Systems

  3. PCA0MD: PCA0 Mode Register PCA0 Counter/Timer Idle Control. Specifies PCA0 behavior when CPU is in Idle Mode PCA Counter/Timer Overflow Interrupt Enable EE/CS-352: Embedded Microcontrollers Systems

  4. PCA Control Register: PCA0CN Compare/Capture Flags PCA Counter/Timer Overflow Flag Counter/Timer Run Control (enable) CF and CCFn can both be enabled to cause interrupt. Only one PCA interrupt vector, so if both are enabled, software must check to see which caused interrupt EE/CS-352: Embedded Microcontrollers Systems

  5. PCA0CPMn Registers Capture Mode EE/CS-352: Embedded Microcontrollers Systems EE/CS-352: Embedded Microcontrollers Systems

  6. PCA – Capture Mode Checks for transition on a CEXn input, and when found, loads value of PCA counter/timer in the capture register: PCA0CP EE/CS-352: Embedded Microcontrollers Systems

  7. PCA – Capture Mode Example: configured for rising edges – frequency measurement: CCFn flag goes high (interrupt if enabled) PCA0 counter value is “captured” in PCA0CP register. Store value. • CCFn flag goes high (interrupt if enabled) • PCA0 counter value is “captured” in PCA0CP register. • Store value. • Subtract this value from the previous value to calculate period. • Frequency is 1/T EE/CS-352: Embedded Microcontrollers Systems

  8. PCA0CPMn Registers Frequency Output Mode EE/CS-352: Embedded Microcontrollers Systems

  9. Frequency Output Mode • Produces a programmable-frequency square wave on the module’s associated CEXn pin. • The capture/compare module high byte holds the number of PCA clocks to count before the output is toggled. Examples: FCEXn = 10 KHz For FPCA = 22.1184 MHz PCA0CPHn = 1106 = 451h For FPCA = 2 MHz PCA0CPHn = 100 = 64h does not fit! Must select clock source appropriate for frequency EE/CS-352: Embedded Microcontrollers Systems

  10. Make some waves! Frequency Output Generation EE/CS-352: Embedded Microcontrollers Systems

More Related