USB VBus Detection

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

USB VBus Detection

1,099 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CarlMle on Wed Feb 06 10:09:37 MST 2013
I am implementing a USB CDC using the USB CDC Rom example from Lpcware.com

http://lpcware.com/content/nxpfile/sample-code-bundle-lpc11uxx-peripherals-using-lpcxpresso

Question 1 :

First issue is reliable USB_VBUS detection. I want to know if USB is plugged in either a PC or charger, So I want to read the state of the USB_VBUS pin P03. (Its a battery powered device)

Using LPC11U24/401 - LPCXpresso 5.0.14_1109

USB CDC is working and I can send + Recv Data over the CDC

No USB cable connected : P0B3=0 P0W3=0xffffffff P0PORT=0x5506bb ( BIT3 is set )
USB Connected : P0B3=0 P0W3=0xffffffff P0PORT=0x5506bb ( BIT3 is set )

So first issue is a disagreement over the pin state, as far as I can see these should all agree? As P0B3 & P0W3 are convenience registers showing the state of BIT3 of Port0. Unless with USB enabled you cant use this as a GPIO?

I've tried both modes on the pin :

PIO0_3 = 0x8 // Pulldown enabled, PIO_3 mode
PIO0_3 = 0x9 // Pulldown enabled, USB_VBUS mode

The result is the same.

Question 2

LPC11Ux User Manual states that the top 64 bits of an LPC11U24/401 Eeprom are reserved for NXP use. Which way is up? is it 0-63 or the last 64 bytes? I can't see a memory map that shows this.


Thanks,
Carl.
标签 (1)
0 项奖励
回复
1 回复

928 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CarlMle on Thu Feb 07 08:03:39 MST 2013
Looks like I may have a back door circuit from my charger on to vbus, but that doesn't explain the various port registers disagreeing with each other.
0 项奖励
回复