Is PRC_SEL 3 or 4 bits

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Is PRC_SEL 3 or 4 bits

ソリューションへジャンプ
1,176件の閲覧回数
CodeWriter
Contributor I

While researching interrupt logic on the MPC5748G processor, on page 611 in the document MPC5748GRM.pdf, Rev.4, bits in PRC_SEL in register INTC_PSRn are shown to be only 3 bits, but looking at source for examples it appears to be 4-bits and aligned differently.  The example code that comes with the S32 Studio, V1.1 has the following configuration so some help here would be appreciated.

 

From pit.c in hello+pll+interrupt example.

 

   INTC.PSR[226].B.PRC_SELN = 0x8;  /* IRQ sent to Core 0 */

 

   INTC.PSR[227].B.PRC_SELN = 0x4;     /* IRQ sent to Core 1 */

 

   INTC.PSR[228].B.PRC_SELN = 0x2;     /* IRQ sent to Core 2 */

ラベル(1)
タグ(1)
0 件の賞賛
1 解決策
1,026件の閲覧回数
alexvinchev
Contributor V

clarkkent​,

priority select is 3 bits, but is up-aligned (if I may state it this way), in the MPC documentation "0" is MSB and "15" or "31" is LSB, so PRC_SEL is like it is defined also in the header files (it works this way, checked!):

union {

    vuint16_t R;

    struct {

        vuint16_t PRC_SELN0:1;

        vuint16_t PRC_SELN1:1;

        vuint16_t PRC_SELN2:1;

        vuint16_t  :1;

        vuint16_t  :3;

        vuint16_t SWTN:1;

        vuint16_t  :4;

        vuint16_t PRIN:4;

    } B;

} PSR[1024];

As you see, examples are also correct, they are using bits 0, 1 and 2 (0x8, 0x4, 0x2). 

元の投稿で解決策を見る

0 件の賞賛
1 返信
1,027件の閲覧回数
alexvinchev
Contributor V

clarkkent​,

priority select is 3 bits, but is up-aligned (if I may state it this way), in the MPC documentation "0" is MSB and "15" or "31" is LSB, so PRC_SEL is like it is defined also in the header files (it works this way, checked!):

union {

    vuint16_t R;

    struct {

        vuint16_t PRC_SELN0:1;

        vuint16_t PRC_SELN1:1;

        vuint16_t PRC_SELN2:1;

        vuint16_t  :1;

        vuint16_t  :3;

        vuint16_t SWTN:1;

        vuint16_t  :4;

        vuint16_t PRIN:4;

    } B;

} PSR[1024];

As you see, examples are also correct, they are using bits 0, 1 and 2 (0x8, 0x4, 0x2). 

0 件の賞賛