Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: PDB0CH1 register definitions

  1. #1

    PDB0CH1 register definitions

    Hi Paul,

    Haven't seen this anywhere else yet - but I'm looking through Teensyduino 1.18 rc3 and don't see register definitions for the PDB triggering of ADC1. From page 757 of the K20 reference manual. If these definitions are already in your register definitions somewhere, could you point me in the right direction?

    Code:
    #define PDB0_CH1C1                               *(volatile uint32_t *)0x40036038 // PDB0 Channel 1 Control Register
    #define PDB0_CH1S                                *(volatile uint32_t *)0x4003603C // PDB0 Channel 1 Status Register
    #define PDB0_CH1DLY0		                 *(volatile uint32_t *)0x40036040 // PDB0 Channel 1 Delay 0 Register
    #define PDB0_CH1DLY1		                 *(volatile uint32_t *)0x40036044 // PDB0 Channel 1 Delay 1 Register
    Additionally, I had some initial confusion with my understanding of the comments in mk20dx128.h in \hardware\teensy\cores\teensy3\. Would the following comment changes be acceptable to make it clear that the register corresponds with channel 0?

    Code:
    #define PDB0_CH0C1		*(volatile uint32_t *)0x40036010 // Channel n Control Register 1
    #define PDB0_CH0S		*(volatile uint32_t *)0x40036014 // Channel n Status Register
    #define PDB0_CH0DLY0		*(volatile uint32_t *)0x40036018 // Channel n Delay 0 Register
    #define PDB0_CH0DLY1		*(volatile uint32_t *)0x4003601C // Channel n Delay 1 Register
    Changed to:

    Code:
    #define PDB0_CH0C1		*(volatile uint32_t *)0x40036010 // Channel 0 Control Register 1
    #define PDB0_CH0S		*(volatile uint32_t *)0x40036014 // Channel 0 Status Register
    #define PDB0_CH0DLY0		*(volatile uint32_t *)0x40036018 // Channel 0 Delay 0 Register
    #define PDB0_CH0DLY1		*(volatile uint32_t *)0x4003601C // Channel 0 Delay 1 Register

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,462
    I've added these.

  3. #3
    Thank you, Paul!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •