Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

input port

input port

2005-08-02 by Farzlina Ab.Hadi

hi, do we actually need to specify the ddr of the port if it to act as input?. I am working on the ADC of mega128. the adc is working fine but there's a small issue on the current. I noticed that if I include in the source code the instruction to set ddrf as input, the current will be high. but if i remark the instruction, the current will be low. Is there any connection?
thank you for any reply.

RE: [AVR-Chat] input port

2005-08-02 by wbounce

ddrf set to 1 makes the port\pins output and enables the pull up resistor which is why the current is high
-----Original Message-----
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of Farzlina Ab.Hadi
Sent: Tuesday, August 02, 2005 5:40 AM
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] input port

hi, do we actually need to specify the ddr of the port if it to act as input?. I am working on the ADC of mega128. the adc is working fine but there's a small issue on the current. I noticed that if I include in the source code the instruction to set ddrf as input, the current will be high. but if i remark the instruction, the current will be low. Is there any connection?
thank you for any reply.

RE: [AVR-Chat] input port

2005-08-03 by Farzlina Ab.Hadi

I configured the ddrf as input by ddrf = 0. But somehow this will make the current higher..I have to check other ports that are inputs. Just to check whether it is only adc related problems or not.
thanks!
-------Original Message-------
From: wbounce
Date: 08/03/05 08:01:15
Subject: RE: [AVR-Chat] input port
ddrf set to 1 makes the port\pins output and enables the pull up resistor which is why the current is high
-----Original Message-----
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of Farzlina Ab.Hadi
Sent: Tuesday, August 02, 2005 5:40 AM
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] input port

hi, do we actually need to specify the ddr of the port if it to act as input?. I am working on the ADC of mega128. the adc is working fine but there's a small issue on the current. I noticed that if I include in the source code the instruction to set ddrf as input, the current will be high. but if i remark the instruction, the current will be low. Is there any connection?
thank you for any reply.

Re: [AVR-Chat] input port

2005-08-03 by Dave Hylands

On 8/2/05, Farzlina Ab.Hadi <elin@sapura.po.my> wrote:
> I configured the ddrf as input by ddrf = 0. But somehow this will make the
> current higher..I have to check other ports that are inputs. Just to check
> whether it is only adc related problems or not.  

When the a port is configured as input, you can write a 1 to PORTF to
enable the pullup resistor and a 0 to PORTF to disable the pullup
resistor.

-- 
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/

OPTOCOUPLER

2005-08-03 by Mansur Mansur

Dear All,

Kindly advise how to use optocoupler 4N25 to isolate microcontroller minimum system to Contactors :

1. Output from Port 0.0 to Optocoupler

2. Ouput from Optocoupler to drive contactor

Questions :

1. What should i do with the base pin of the transistor

2. What is the value of the pull up resistor to drive 12V DC to contactor

Please comment.

Thanks

Mansur

Send instant messages to your online friends http://asia.messenger.yahoo.com

Re: [AVR-Chat] OPTOCOUPLER

2005-08-03 by Ralph Hilton

On Wed, 3 Aug 2005 12:31:14 +0800 (CST) you wrote:

>
>Dear All,
>
>Kindly advise how to use optocoupler 4N25  to isolate microcontroller minimum system to Contactors :
>
>1. Output from Port 0.0 to Optocoupler 
>
>2. Ouput from Optocoupler to drive contactor
>
>Questions :
>
>1. What should i do with the base pin of the transistor
>
>2. What is the value of the pull up resistor to drive 12V DC to contactor
>
>Please comment.
>
>Thanks
>
>Mansur

How much current does the "contactor" need?
--
Ralph Hilton
http://www.ralphhilton.org
C-Meter: http://www.cmeter.org
FZAOINT http://www.fzaoint.net

Re: [AVR-Chat] OPTOCOUPLER

2005-08-03 by Robert Adsett

At 02:08 PM 8/3/05 +0200, Ralph Hilton wrote:
>On Wed, 3 Aug 2005 12:31:14 +0800 (CST) you wrote:
>
> >
> >Dear All,
> >
> >Kindly advise how to use optocoupler 4N25  to isolate microcontroller 
> minimum system to Contactors :
> >
> >1. Output from Port 0.0 to Optocoupler
> >
> >2. Ouput from Optocoupler to drive contactor
> >
> >Questions :
> >
> >1. What should i do with the base pin of the transistor
> >
> >2. What is the value of the pull up resistor to drive 12V DC to contactor
> >
> >Please comment.
> >
> >Thanks
> >
> >Mansur
>
>How much current does the "contactor" need?

Indeed, the devices I refer to as contactors usually draw from 800ma to 
over 3A to pull in the tips.  Well over the rating of most optocouplers.  A 
simple reed relay on the other hand...

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,   be 
they legal, genetic, or physical.  If you don't believe me, try to chew a 
radio signal. "  -- Kelvin Throop, III
http://www.aeolusdevelopment.com/

Re: [AVR-Chat] input port

2005-08-03 by Bruce Parham

If low power in needed, all i/o pins need to be in valid high or low states. A floating input
that has drifted to some intermediate level can cause the input buffer to draw more current
than it would with a valid input. The simplest way to handle this, with an avr, is to set all
unused (unconnected) i/o pins to outputs. This forces the pin into a valid level and the input
buffer will not draw excessive current.

Some older avr parts have a few input only pins. The only way to insure that thay have valid
levels is to tie them high or low.

Bruce


Farzlina Ab.Hadi wrote:
Show quoted textHide quoted text
> I configured the ddrf as input by ddrf = 0. But somehow this will make 
> the current higher..I have to check other ports that are inputs. Just 
> to check whether it is only adc related problems or not. 
>  thanks!
> -------Original Message-------
>  
> From: wbounce <mailto:wbounce@safeplace.net>
> Date: 08/03/05 08:01:15
> To: AVR-Chat@yahoogroups.com <mailto:AVR-Chat@yahoogroups.com>
> Subject: RE: [AVR-Chat] input port
>  
> ddrf set to 1 makes the port\pins output and enables the pull up 
> resistor which is why the current is high
> -----Original Message-----
> From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On 
> Behalf Of Farzlina Ab.Hadi
> Sent: Tuesday, August 02, 2005 5:40 AM
> To: AVR-Chat@yahoogroups.com
> Subject: [AVR-Chat] input port
> 
> hi, do we actually need to specify the ddr of the port if it to act as 
> input?.  I am working on the ADC of mega128. the adc is working fine but 
> there's a small issue on the current. I noticed that if I include in the 
> source code the instruction to set ddrf as input, the current will be 
> high. but if i remark the instruction, the current will be low. Is there 
> any connection?
>  
> thank you for any reply.
> 		
>

Re: [AVR-Chat] AVRFreaks

2005-08-03 by Jeffrey Engel

AVRFreaks.net seems to be back up.

Jeff Engel


Happiness is - positive intake manifold pressure.


		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs

Re: [AVR-Chat] OPTOCOUPLER

2005-08-03 by Ralph Hilton

On Wed, 03 Aug 2005 11:10:23 -0400 you wrote:

>At 02:08 PM 8/3/05 +0200, Ralph Hilton wrote:
>>On Wed, 3 Aug 2005 12:31:14 +0800 (CST) you wrote:
>>
>> >
>> >Dear All,
>> >
>> >Kindly advise how to use optocoupler 4N25  to isolate microcontroller 
>> minimum system to Contactors :
>> >
>> >1. Output from Port 0.0 to Optocoupler
>> >
>> >2. Ouput from Optocoupler to drive contactor
>> >
>> >Questions :
>> >
>> >1. What should i do with the base pin of the transistor
>> >
>> >2. What is the value of the pull up resistor to drive 12V DC to contactor
>> >
>> >Please comment.
>> >
>> >Thanks
>> >
>> >Mansur
>>
>>How much current does the "contactor" need?
>
>Indeed, the devices I refer to as contactors usually draw from 800ma to 
>over 3A to pull in the tips.  Well over the rating of most optocouplers.  A 
>simple reed relay on the other hand...

ok, it is good when you want a meaningful answer to give as much data as possible.

How about using a logic level MOSFET?


--
Ralph Hilton
http://www.ralphhilton.org
C-Meter: http://www.cmeter.org
FZAOINT http://www.fzaoint.net

Re: [AVR-Chat] OPTOCOUPLER

2005-08-03 by Robert Adsett

At 09:23 PM 8/3/05 +0200, Ralph Hilton wrote:
>On Wed, 03 Aug 2005 11:10:23 -0400 you wrote:
>
> >At 02:08 PM 8/3/05 +0200, Ralph Hilton wrote:
> >>On Wed, 3 Aug 2005 12:31:14 +0800 (CST) you wrote:
> >>
> >> >
> >> >Dear All,
> >> >
> >> >
> >> >Thanks
> >> >
> >> >Mansur
> >>
> >>How much current does the "contactor" need?
> >
> >Indeed, the devices I refer to as contactors usually draw from 800ma to
> >over 3A to pull in the tips.  Well over the rating of most optocouplers.  A
> >simple reed relay on the other hand...
>
>ok, it is good when you want a meaningful answer to give as much data as 
>possible.
>
>How about using a logic level MOSFET?

Ralph, I think you've confused me with the original poster :)

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,   be 
they legal, genetic, or physical.  If you don't believe me, try to chew a 
radio signal. "  -- Kelvin Throop, III
http://www.aeolusdevelopment.com/

Re: [AVR-Chat] OPTOCOUPLER

2005-08-05 by Mansur Mansur

Robert,
250mA, 12Vdc is enough to drive the contactor, I use 220KOhm Resistor for the pull up. Please check the attachment i have sent previously, the internal phototransistor has base pin which i have no idea where to connect to..please comment
Mansur

Robert Adsett wrote:
Show quoted textHide quoted text
At 09:23 PM 8/3/05 +0200, Ralph Hilton wrote:
>On Wed, 03 Aug 2005 11:10:23 -0400 you wrote:
>
> >At 02:08 PM 8/3/05 +0200, Ralph Hilton wrote:
> >>On Wed, 3 Aug 2005 12:31:14 +0800 (CST) you wrote:
> >>
> >> >
> >> >Dear All,
> >> >
> >> >
> >> >Thanks
> >> >
> >> >Mansur
> >>
> >>How much current does the "contactor" need?
> >
> >Indeed, the devices I refer to as contactors usually draw from 800ma to
> >over 3A to pull in the tips. Well over the rating of most optocouplers. A
> >simple reed relay on the other hand...
>
>ok, it is good when you want a meaningful answer to give as much data as
>possible.
>
>How about using a logic level MOSFET?

Ralph, I think you've confused me with the original poster :)

Robert

" 'Freedom' has no meaning of itself. There are always restrictions, be
they legal, genetic, or physical. If you don't believe me, try to chew a
radio signal. " -- Kelvin Throop, III
http://www.aeolusdevelopment.com/

Send instant messages to your online friends http://asia.messenger.yahoo.com

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.