Pull-down resistor on LPC1114

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

Pull-down resistor on LPC1114

3,619 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc_veter on Sun May 15 03:08:46 MST 2011
Hello.
How to make value on port equal to zero when it isn't used?

Recently has started to program on a debug board microcontroller LPC1114 (LPCXpresso LPC1114) there was some question.
Tell correctly I understand or not.

I write the code (for example for Р0.7):
LPC_IOCON-> PIO0_7 and = ~0x07;    //we Clear bits output functions   
                                      //responsible for a choice.
LPC_IOCON-> PIO0_7 | = 0x08;      //we Install for an output function
                               //PIO0_7and the lower tightening resistance

After that code should P0.7 be low when it is not used or physically tightening resistance is necessary on it still to deliver?

Kind regards, Vyacheslav.
0 项奖励
回复
13 回复数

3,508 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Sun May 15 22:41:54 MST 2011

Quote: atomicdog
I guess I should download the new manual sometime instead of referencing the old one. :):o



Zero let NXP_Europe and I know in March.:):o

http://knowledgebase.nxp.com/showpost.php?p=6526&postcount=15
0 项奖励
回复

3,508 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by atomicdog on Sun May 15 22:28:37 MST 2011

Quote: larryvc
Shouldn't that be Figure 8?

[COLOR=#005042][COLOR=#005042][FONT=Arial][COLOR=#005042]UM10398[/COLOR][/FONT][/COLOR][/COLOR]
[COLOR=#005042][COLOR=#005042][COLOR=#005042][COLOR=#005042][COLOR=#005042][FONT=Arial][COLOR=#005042]LPC111x/LPC11Cxx User manual[/COLOR][/FONT][/COLOR][/COLOR][/COLOR][/COLOR][/COLOR]
[COLOR=#005042][COLOR=#005042][FONT=Arial][COLOR=#005042]Rev. 4 — 4 March 2011 User Manual[/COLOR][/FONT][/COLOR][/COLOR]


I guess I should download the new manual sometime instead of referencing the old one. :):o
0 项奖励
回复

3,508 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Sun May 15 21:23:06 MST 2011

Quote: atomicdog
Please look at Figure 7 in section 7.3 of the User Manual to see.



Shouldn't that be Figure 8?

[COLOR=#005042][COLOR=#005042][FONT=Arial][COLOR=#005042]UM10398[/COLOR][/FONT][/COLOR][/COLOR]
[COLOR=#005042][COLOR=#005042][COLOR=#005042][COLOR=#005042][COLOR=#005042][FONT=Arial][COLOR=#005042]LPC111x/LPC11Cxx User manual[/COLOR][/FONT][/COLOR][/COLOR][/COLOR][/COLOR][/COLOR]
[COLOR=#005042][COLOR=#005042][FONT=Arial][COLOR=#005042]Rev. 4 — 4 March 2011 User Manual[/COLOR][/FONT][/COLOR][/COLOR]
0 项奖励
回复

3,508 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by atomicdog on Sun May 15 20:53:36 MST 2011

Quote: mc_veter
I want to use an pin as an output and to make it with Pull-down resistor. It can be done? Or such it is accessible only when the pin is an input.

Kind regards, Vyacheslav.

Please look at Figure 7 in section 7.3 of the User Manual(Rev. 3 — 14 January 2011) to see.
0 项奖励
回复

3,508 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by larryvc on Sun May 15 13:23:09 MST 2011
Never, Never, Never question or doubt Zero's replies.:eek::D


Quote: KTownsend
You should link to a basic C manual on Amazon ... with the referrals you're bound to get answering the same problems over an over you should be able to retire well before 65. ;)



That's a great idea.;)

You might find this site useful:

http://www.cprogramming.com/tutorial/bitwise_operators.html
0 项奖励
回复

3,508 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ktownsend on Sun May 15 13:09:34 MST 2011

Quote: Zero
LPC_IOCON->PIO0_7 &= ~0x1F;    //clear bit 0-4    



You should link to a basic C manual on Amazon ... with the referrals you're bound to get answering the same problems over an over you should be able to retire well before 65.
0 项奖励
回复

3,508 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sun May 15 10:19:23 MST 2011
LPC_IOCON->PIO0_7 &= ~0x1F;    //clear bit 0-4    
0 项奖励
回复

3,508 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc_veter on Sun May 15 10:06:35 MST 2011

Quote: Zero
No, I'm right :)

As described before you didn't reset bit 4 (which is set by default).

So you switch to MODE = 3 = Repeater MODE.

If you don't believe me, please use your debugger to check this (I've done this before).

That is your debugger saying about IOCON_PIO0_7?



How in my case it is possible to nullify bit 4 to disconnect the Repeater MODE?
0 项奖励
回复

3,508 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sun May 15 09:23:44 MST 2011
No, I'm right :)

As described before you didn't reset bit 4 (which is set by default).

So you switch to MODE = 3 = Repeater MODE.

If you don't believe me, please use your debugger to check this (I've done this before).

That is your debugger saying about IOCON_PIO0_7?
0 项奖励
回复

3,508 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc_veter on Sun May 15 09:15:58 MST 2011

Quote: Zero
No :)

You've reset bit 0-2 and set bit 3. With bit 4 set by default you switched successfully to 'Repeater Mode'. :) Is that what you intended?

Note: Your debugger can show you  IOCON and also GPIO0 in Peripherals View.



No. I think you aren't right. In user manual it is written that:

IOCON_PIO0_7 register (IOCON_PIO0_7, address 0x4004 4050) bit description

Bit    Symbol Value Description 
2:0    FUNC         Selects pin function. All other values are reserved.
              0x0   Selects function PIO0_7.
              0x1   Select function CTS.
4:3   MODE Selects function mode (on-chip pull-up/pull-down resistor
control).
              0x0 Inactive (no pull-down/pull-up resistor enabled).
              0x1 Pull-down resistor enabled.
              0x2 Pull-up resistor enabled.
              0x3 Repeater mode.

If to follow this description I select: "Pull-down resistor enabled." and "Selects function PIO0_7.".
Or I not correctly write the program code?

Kind regards, Vyacheslav.
0 项奖励
回复

3,508 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc_veter on Sun May 15 09:02:59 MST 2011

Quote: gbm
Set the pin to input and enable pulldown register.



I want to use an pin as an output and to make it with Pull-down resistor. It can be done? Or such it is accessible only when the pin is an input.

Kind regards, Vyacheslav.
0 项奖励
回复

3,508 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sun May 15 03:32:17 MST 2011

Quote: mc_veter
After that code should P0.7 be low when it is not used or physically tightening resistance is necessary on it still to deliver?



No :)

You've reset bit 0-2 and set bit 3. With bit 4 set by default you switched successfully to 'Repeater Mode'. :) Is that what you intended?

Note: Your debugger can show you  IOCON and also GPIO0 in Peripherals View.
0 项奖励
回复

3,508 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gbm on Sun May 15 03:13:27 MST 2011
Set the pin to input and enable pulldown register.
0 项奖励
回复