returning an IO to a GPIO after HWPWM

Questions on other types of hardware and getting it talking to the ARM CPU
Post Reply
Posts: 1463
Joined: Fri Oct 19, 2012 5:11 am

returning an IO to a GPIO after HWPWM

Post by YahooArchive » Sun Feb 10, 2013 8:25 pm

>from the help line
>I want to use the HWPWM command in the ARMexpress lite. It works fine but once
on how do I turn if off and get the IO pin to go back to just a normal output?
Doing the IO(x)=1 doesn\\\'t seem to work.

To engage the HWPWM the IO PINSEL register was programmed for Timer Match
output. To change it back you have to write to the PINSEL register. Details on
this in the NXP User Manual, or look at the HWPWM.bas file.

For instance this line of code in HWPWM.bas

PCB_PINSEL1 = PCB_PINSEL1 or &H00000080 'IO(11)

sets bits 7 and 6 to select the match output.

To make it a GPIO again bits 7 and 6 should be set to 0.

PCB_PINSEL1 = PCB_PINSEL1 and not &H000000c0

Post Reply