SCT capture register read-only? (CAPCTRL)

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

SCT capture register read-only? (CAPCTRL)

1,103件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by DennisFrie on Thu May 15 09:59:07 MST 2014
Hi
I'm currently setting up a normal input capture on timer 1 and everything works as expected - except when trying to set the control register for the capture control register.

When trying to write the following :
LPC_SCT1 -> CAPCTRL[0].U = (1 << 0);

I get this error:
error: assignment of member 'U' in read-only object
(It doesn't matter if I write to U, L or H, same error, CAPCTRL is read-only)

The register is listed as R/W in the datasheet and I don't see any other way to configure this? Is this a stupid mistake from my side or a problem with LPCOpen?

LPCOpen v. 2.08B
LPCExpresso 7.1.1_125
LPC1549 dev. board
ラベル(1)
0 件の賞賛
返信
2 返答(返信)

1,069件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by DennisFrie on Thu May 15 11:26:07 MST 2014
Yup, that did the trick and seems to work just fine.
I was just expecting a mistake from my side  :p

Thanks a lot!
0 件の賞賛
返信

1,069件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu May 15 10:42:24 MST 2014
Just change it in sct_15xx.h...

From:

[color=#f00]__I[/color] union {
uint32_t U;/*!<       CAPCTRL.U  Unified 32-bit register */
struct {
uint16_t L;/*!<       CAPCTRL.L  Access to L value */
uint16_t H;/*!<       CAPCTRL.H  Access to H value */
};

} CAPCTRL[CONFIG_SCT_nRG];



to:

[color=#f00]__IO [/color]union {
uint32_t U;/*!<       CAPCTRL.U  Unified 32-bit register */
struct {
uint16_t L;/*!<       CAPCTRL.L  Access to L value */
uint16_t H;/*!<       CAPCTRL.H  Access to H value */
};

} CAPCTRL[CONFIG_SCT_nRG];

0 件の賞賛
返信