Clearing a bit in SYSAHBCLKCTRL

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Clearing a bit in SYSAHBCLKCTRL

327 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ECamino on Mon Mar 11 07:00:02 MST 2013
Hi,

I'm working with LPC1347.  I'm  having trouble with IAP call for bootloading.  It's intermittent even after disabling all peripheral timers.  I think the problem is my USART.  I would like to turn off/disable the previously enabled USART peripheral. 

Stepping through and watching SYSCON.  I see that both these lines of code disables ALL the bits in SYSAHBCLKCTRL, except SYS (b0).
[SIZE=2]
LPC_SYSCON->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]SYSAHBCLKCTRL[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] &=  (0<<12); [/SIZE]
[SIZE=2]LPC_SYSCON->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]SYSAHBCLKCTRL[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] &=  0xFFFFEFFF; [/SIZE]
[SIZE=2][/SIZE]
[SIZE=2]I just want to clear SYSAHBCLKCTRL b12.  Why doesn't the code above work and how do you clear a single bit in SYSAHBCLKCTRL?[/SIZE]
[SIZE=2][/SIZE]
[SIZE=2]Thanks,[/SIZE]
[SIZE=2][/SIZE]
[SIZE=2]EC[/SIZE]
0 Kudos
4 Replies

318 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ECamino on Tue Mar 12 06:13:55 MST 2013
Very strange!  Today both lines below are now working...must have been some kind error that cleared when rebooted PC today?

[SIZE=2]LPC_SYSCON->[COLOR=#0000c0][COLOR=#0000c0]SYSAHBCLKCTRL[/COLOR][/COLOR] &= ~(1<<12); [/SIZE]
[SIZE=2]LPC_SYSCON->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]SYSAHBCLKCTRL[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] &= 0xFFFFEFFF; [/SIZE]

Thanks,

EC
0 Kudos

317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Mar 11 07:38:18 MST 2013
:confused:

That's correct code and working here with other MCUs :)

So what's happening if you switch bit 12 in debugger?
0 Kudos

317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ECamino on Mon Mar 11 07:17:28 MST 2013
[SIZE=2]Sorry, should have said I tried this too: LPC_SYSCON->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]SYSAHBCLKCTRL[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] &= ~(1<<12); [/SIZE]
[SIZE=2][COLOR=#3f7f5f][/COLOR][/SIZE]
[SIZE=2][COLOR=black]Doesn't work either!:confused:[/COLOR][/SIZE]
0 Kudos

317 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Mar 11 07:08:57 MST 2013

Quote: ECamino

[SIZE=2]I just want to clear SYSAHBCLKCTRL b12.  Why doesn't the code above work and how do you clear a single bit in SYSAHBCLKCTRL?[/SIZE]


Then just clear bit 12
[B][SIZE=2]LPC_SYSCON->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]SYSAHBCLKCTRL[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=Red] &= ~[/COLOR]([COLOR=SeaGreen]1[/COLOR]<<12); [/SIZE][/B]
0 Kudos