LPC1768 Landtiger board USB configuration

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC1768 Landtiger board USB configuration

832 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andy_man on Sun Apr 03 08:04:18 MST 2016
Hi all,

I am trying to use the PLL0 clock to drive the USB clock at 48 MHz, which I accomplished. Now I am trying to configure the USB peripheral. In my program so far I setup the PLL0 clock. Then I successfully enabled PCUSB. But when I try and turn on the DEV_CLK_ON bit and the AHB_CLK_ON bit the LPC_USB->USBClkSt register does not show that the bits have been enabled in simulation. My goal is to initialize and configure the USB peripheral on my own so I get a good understanding of how it functions.

//my code to setup the USB
void usb_setup(void){

LPC_SC -> PCONP |= 0x80000000; //enable PCUSB
LPC_USB->USBClkCtrl = 0x1A; //turn on DEV_CLK_ON and AHB_CLK_ON

while((LPC_USB->USBClkSt & 0x1A) != 0x1A); //wait until the USBClkSt register recognizes the changes in USBClkCtrl

return;
}
标签 (1)
0 项奖励
回复
3 回复数

744 次查看
lpcware
NXP Employee
NXP Employee
bump
0 项奖励
回复

744 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andy_man on Mon Apr 04 09:48:32 MST 2016
Tanks for the suggestion, I will take a look at the OTG chapter and see what effect enabling all clocks has.
0 项奖励
回复

744 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Mon Apr 04 09:24:16 MST 2016
Look at the OTG clock control register.

I am doing host mode (non OTG) and thought to leave the device and I2C clock bits unset.
But to allow peripheral view in the dubugger I had to enable ALL clocks (i.e OTGCLOCK = 0x1F rather than 0x19)
Note the description is in the OTG chapter but it (and the function select register) apply also to device and host modes.

HTH, Mike.
0 项奖励
回复