Yahoo Groups archive

AVR-Chat

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

Thread

switch ratings

switch ratings

2008-03-18 by Steven Hodge

I know this isn't anything about uC's but I have a general question
regarding toggle switch ratings, and there seem to be a lot of very
knowledgeable people on this list.  Typically a data sheet rates a switch
for, say, 125 VAC, 250 VAC and 28 VDC.  My applications, however, are
typically 12 VDC.  Can I convert the 28 VDC rating to 12 VDC using a same
power equivalent, ie, if the 28 VDC rating is 4 A, then is it ok to run the
switch up to 28/12 x 4 = about 8 or 9 A?   Thanks, Steve

Re: [AVR-Chat] switch ratings

2008-03-18 by Sander Pool

Hi Steve,

I'm no expert but looking at Ohms law I think it's safe to say that the 
current rating is voltage independent. After all the resistance of the 
switch is more or less constant as is the power dissipation capacity.

Voltage rating deals with how much voltage can be applied to an open 
switch while still maintaining 'open' status and not sparking. This 
depends on the distance between the contacts. It probably is also 
related to how resistant the contacts are to arcing when contact is 
made. If you put 1000V on a 120V switch you may blow away quite a bit of 
contact material each time you close the switch.

    Sander

Steven Hodge wrote:
Show quoted textHide quoted text
>
> I know this isn't anything about uC's but I have a general question
> regarding toggle switch ratings, and there seem to be a lot of very
> knowledgeable people on this list. Typically a data sheet rates a switch
> for, say, 125 VAC, 250 VAC and 28 VDC. My applications, however, are
> typically 12 VDC. Can I convert the 28 VDC rating to 12 VDC using a same
> power equivalent, ie, if the 28 VDC rating is 4 A, then is it ok to 
> run the
> switch up to 28/12 x 4 = about 8 or 9 A? Thanks, Steve
>
>

Re: switch ratings

2008-03-18 by Zack Widup

I believe Sander is right. I'd keep the same current rating for lower 
DC voltages as for 28 volts.

Part of the reason the AC and lower voltage DC ratings are different 
is because of the arcing potential when you turn the switch off. 

Zack

--- In AVR-Chat@yahoogroups.com, Sander Pool <sander@...> wrote:
>
> 
> Hi Steve,
> 
> I'm no expert but looking at Ohms law I think it's safe to say that 
the 
> current rating is voltage independent. After all the resistance of 
the 
> switch is more or less constant as is the power dissipation 
capacity.
> 
> Voltage rating deals with how much voltage can be applied to an 
open 
> switch while still maintaining 'open' status and not sparking. This 
> depends on the distance between the contacts. It probably is also 
> related to how resistant the contacts are to arcing when contact is 
> made. If you put 1000V on a 120V switch you may blow away quite a 
bit of 
> contact material each time you close the switch.
> 
>     Sander
> 
> Steven Hodge wrote:
> >
> > I know this isn't anything about uC's but I have a general 
question
> > regarding toggle switch ratings, and there seem to be a lot of 
very
> > knowledgeable people on this list. Typically a data sheet rates a 
switch
> > for, say, 125 VAC, 250 VAC and 28 VDC. My applications, however, 
are
> > typically 12 VDC. Can I convert the 28 VDC rating to 12 VDC using 
a same
> > power equivalent, ie, if the 28 VDC rating is 4 A, then is it ok 
to 
Show quoted textHide quoted text
> > run the
> > switch up to 28/12 x 4 = about 8 or 9 A? Thanks, Steve
> >
> >
>

Re: [AVR-Chat] switch ratings

2008-03-18 by David Kelly

On Mar 18, 2008, at 11:59 AM, Sander Pool wrote:

> I'm no expert but looking at Ohms law I think it's safe to say that  
> the
> current rating is voltage independent. After all the resistance of the
> switch is more or less constant as is the power dissipation capacity.


Yes, an amp is an amp no matter the voltage. Same for switches as for  
wires. The conductor determines the current capacity while insulation  
determines the voltage rating.

AC voltage ratings are higher than DC because its alternating. Any arc  
struck when the switch is changing will end in the next half cycle or  
cycle. Most any switch or relay will spark when switched near its max  
ratings.

--
David Kelly N4HHE, dkelly@HiWAAY.net
============================================================
Whom computers would destroy, they must first drive mad.

Re: [AVR-Chat] switch ratings

2008-03-18 by David VanHorn

The voltage ratings on switches are similar to those on fuses.
Above that voltage, the switch is not guaranteed to be able to break
the circuit.
This has to do with inductance in the load, and for a large enough
inductor, no reasonable switch will work.

Re: [AVR-Chat] Re: switch ratings

2008-03-18 by David VanHorn

On Tue, Mar 18, 2008 at 2:07 PM, Zack Widup <w9sz@prairienet.org> wrote:
>
> I believe Sander is right. I'd keep the same current rating for lower
> DC voltages as for 28 volts.

Right, current is just current, the voltage across a closed switch is
essentially zero.

RE: [AVR-Chat] Re: switch ratings

2008-03-18 by Steven Hodge

Thanks for all your input.  Got it.   I'll use the 28 VDC rating for 12 v.
I need to make/break 3.5A so I'll have to switch (pun intended) to a switch
rated at 4 A at 28 VDC instead of the 3 A one I was hoping to use (for
aesthetic compatibility with adjacent switches).  Steve
Show quoted textHide quoted text
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of David VanHorn
Sent: Tuesday, March 18, 2008 11:24 AM
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] Re: switch ratings

 

On Tue, Mar 18, 2008 at 2:07 PM, Zack Widup <w9sz@prairienet.org
<mailto:w9sz%40prairienet.org> > wrote:
>
> I believe Sander is right. I'd keep the same current rating for lower
> DC voltages as for 28 volts.

Right, current is just current, the voltage across a closed switch is
essentially zero.

 

__________ NOD32 2957 (20080318) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



[Non-text portions of this message have been removed]

Re: [AVR-Chat] Re: switch ratings

2008-03-19 by Roy E. Burrage

It looks like this application is handled, Steven.  You might also want 
to keep the following in mind for future apps:

Silver alloys are fine for "power" applications but they're severely 
limited when you get down in the mud with really low currents because 
the contacts will build up an oxide or a sulfide coating.  This is why 
they depend on the small amount of arcing that will occur in a power 
circuit.  At low currents, such as driving a logic input, you'll need 
gold inlay or a gold flask over silver contacts.  The same holds true 
for relays.  Be sure to9 look at the minimum current ratings for 
switching devices.  There's also a difference between switching current 
and carrying current capacities.

Voice of experience...don't ever try to drive a logic input with the 
auxiliary contacts of a motor starter.


REB



Steven Hodge wrote:
> Thanks for all your input.  Got it.   I'll use the 28 VDC rating for 12 v.
> I need to make/break 3.5A so I'll have to switch (pun intended) to a switch
> rated at 4 A at 28 VDC instead of the 3 A one I was hoping to use (for
> aesthetic compatibility with adjacent switches).  Steve
>
>  
>
> From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
> Of David VanHorn
> Sent: Tuesday, March 18, 2008 11:24 AM
> To: AVR-Chat@yahoogroups.com
> Subject: Re: [AVR-Chat] Re: switch ratings
>
>  
>
> On Tue, Mar 18, 2008 at 2:07 PM, Zack Widup <w9sz@prairienet.org
> <mailto:w9sz%40prairienet.org> > wrote:
>   
>> I believe Sander is right. I'd keep the same current rating for lower
>> DC voltages as for 28 volts.
>>     
>
> Right, current is just current, the voltage across a closed switch is
> essentially zero.
>
>  
>   


[Non-text portions of this message have been removed]

Re: [AVR-Chat] Re: switch ratings

2008-03-19 by David VanHorn

> Silver alloys are fine for "power" applications but they're severely
> limited when you get down in the mud with really low currents because
> the contacts will build up an oxide or a sulfide coating.  This is why
> they depend on the small amount of arcing that will occur in a power
> circuit.  At low currents, such as driving a logic input, you'll need
> gold inlay or a gold flask over silver contacts.  The same holds true
> for relays.  Be sure to9 look at the minimum current ratings for
> switching devices.  There's also a difference between switching current
> and carrying current capacities.
>

It's called "wetting current" and even gold-on-gold needs some small current.
Litton made that mistake with their first shock sensors for glass break.
The switches would stay closed for hours or days or weeks, then open
up for a few seconds for no apparent reason.

Re: [AVR-Chat] Re: switch ratings

2008-03-19 by Roy E. Burrage

No electro-mechanical switching device will do well with less than a 
very few micro amps, but with those really eensie weensie currents found 
in what's considered to be a "dry" circuit, less than 100 micro amps, 
the contact pressures must also be high.  For dry circuit applications 
there are a variety of schemes used depending upon other mechanical 
needs.  High contact pressures and contact alloys are the primary 
mechanisms used to ensure reliable low current operation.  Contact style 
is also a factor from time to time.

I can see where a vibration sensor would need to have small contact 
pressures in order to operate properly.  I thought most vibration/shock 
sensors these days are piezoelectric devices.

"Bifurcated contacts" always sounded a little nasty to me.


REB



David VanHorn wrote:
>> Silver alloys are fine for "power" applications but they're severely
>> limited when you get down in the mud with really low currents because
>> the contacts will build up an oxide or a sulfide coating.  This is why
>> they depend on the small amount of arcing that will occur in a power
>> circuit.  At low currents, such as driving a logic input, you'll need
>> gold inlay or a gold flask over silver contacts.  The same holds true
>> for relays.  Be sure to9 look at the minimum current ratings for
>> switching devices.  There's also a difference between switching current
>> and carrying current capacities.
>>
>>     
>
> It's called "wetting current" and even gold-on-gold needs some small current.
> Litton made that mistake with their first shock sensors for glass break.
> The switches would stay closed for hours or days or weeks, then open
> up for a few seconds for no apparent reason.
>
>   


[Non-text portions of this message have been removed]

Re: [AVR-Chat] Re: switch ratings

2008-03-19 by David VanHorn

> I can see where a vibration sensor would need to have small contact
> pressures in order to operate properly.  I thought most vibration/shock
> sensors these days are piezoelectric devices.

These were gold plated rings sitting on gold plated pins, in a sealed capsule.
Upping the loop current 10x did amazing things for their stability,
and was incorporated into later versions of the design.

RE: [AVR-Chat] Re: switch ratings

2008-03-19 by Steven Hodge

Well, once again this forum is a wealth of valuable information.   You all
have brought up a problem I may have at the other end of the spectrum.  I
have a switch panel, in use now for over 5 years, that can be exposed to the
environment, ie, occasional rain or splashing (but not dunking).   I am
using sealed toggle switches, two brands, NKK series WT, and  Honeywell
1NT1.   The switches were chosen strictly for this sealed aspect and carry
some current when closed, 20 to 300 mA depending on the switch.   The NKK
contacts are rated at 10 A at 30 VDC and the 1NT at 20 A at 28 VDC, way
overkill but that's all I could find in sealed switches.

 

However, I am switching over to a uC system and now want these switches to
just supply a logic signal, 3V level.  After the responses to my original
post I checked the specs on the switches.  The NKK have parts which are
various combinations of copper and silver, but no gold.  The Honeywell data
sheet says "Honeywell MICRO SWITCH does not recommend the use of silver
cadmium oxide switch contacts in non-arcing loads. Non-arcing loads are
generally loads less than 12 volts and/or 0.5 amp. NT switches use silver
cadmium oxide contacts."   This is interesting because even my original use
of them (12V, 20 to 300 mA) does not meet this spec but nonetheless the
switches have worked fine for 5 years, and continue to do so.  Neither data
sheet specifically specifies a minimum, or wetting, current.

 

Anyway, my new use of the switches will be much less current.  As the uC
circuit is right now I am using external 35K pull-ups, a value chosen to be
roughly the same as the internal pull-ups in the Atmel uC.  This implies a
current when closed of about 86 uA.  So the problems you all mention could
now arise.  

 

So what are my options?  They seem pretty limited, perhaps non-existent.  I
have  tried looking for gold contact switches that are also sealed but came
up with zilch.   It looks like the only gold contact switches available are
for protected environments.   I would also have to have a new panel made as
the existing switches use 15/32" holes.

 

Would the fact the switches are sealed prevent residue from forming?   (The
Honeywell data sheet seems to imply the answer is no.)

 

If a problem arises with a switch, ie, it ceases to give a logic signal,
could I open the panel up and "restore" the switch by making it temporarily
make/break a current near its maximum rating?  Would the arcing break up the
residue enough to get the switch working again?

 

What about putting a capacitor across the switch, without any resistor, to
force arcing to occur every time the switch is used?

 

Does someone know a source of low current switches that are sealed and can
be exposed to the environment?   I suppose a mercury type switch would work
but I've only been able to find those as tilt switches, so couldn't be used
in a fixed panel mount.

 

Steve

 

PS.  Incidentally, during my research I found a table on the NKK website,
http://www.nkkswitches.com/pdf/electricalratings.pdf, that allows one to
calculate a rating for conditions other than specified.   The table gives a
factor of 1.25 for 12 VDC relative to a switch rated at 30 VDC.   Thus a 4
A/30 VDC switch could use up to 5 A at 12 VDC.  Not relevant here but is
relevant to my original post.
Show quoted textHide quoted text
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of Roy E. Burrage
Sent: Tuesday, March 18, 2008 6:23 PM
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] Re: switch ratings

 

It looks like this application is handled, Steven. You might also want 
to keep the following in mind for future apps:

Silver alloys are fine for "power" applications but they're severely 
limited when you get down in the mud with really low currents because 
the contacts will build up an oxide or a sulfide coating. This is why 
they depend on the small amount of arcing that will occur in a power 
circuit. At low currents, such as driving a logic input, you'll need 
gold inlay or a gold flask over silver contacts. The same holds true 
for relays. Be sure to9 look at the minimum current ratings for 
switching devices. There's also a difference between switching current 
and carrying current capacities.

Voice of experience...don't ever try to drive a logic input with the 
auxiliary contacts of a motor starter.

REB

Steven Hodge wrote:
> Thanks for all your input. Got it. I'll use the 28 VDC rating for 12 v.
> I need to make/break 3.5A so I'll have to switch (pun intended) to a
switch
> rated at 4 A at 28 VDC instead of the 3 A one I was hoping to use (for
> aesthetic compatibility with adjacent switches). Steve
>
> 
>



 



[Non-text portions of this message have been removed]

Re: [AVR-Chat] Re: switch ratings

2008-03-19 by David Kelly

On Wed, Mar 19, 2008 at 08:22:11AM -0700, Steven Hodge wrote:
> 
> However, I am switching over to a uC system and now want these
> switches to just supply a logic signal, 3V level.  After the responses
> to my original post I checked the specs on the switches.  The NKK have
> parts which are various combinations of copper and silver, but no
> gold.  The Honeywell data sheet says "Honeywell MICRO SWITCH does not
> recommend the use of silver cadmium oxide switch contacts in
> non-arcing loads. Non-arcing loads are generally loads less than 12
> volts and/or 0.5 amp. NT switches use silver cadmium oxide contacts."
> This is interesting because even my original use of them (12V, 20 to
> 300 mA) does not meet this spec but nonetheless the switches have
> worked fine for 5 years, and continue to do so.  Neither data sheet
> specifically specifies a minimum, or wetting, current.

If the switch is regularly toggled the contacts are probably "wiping"
and keeping themselves clean and healthy.

I suggest in your redesign its time to consider membrane switches. There
are shops that can produce membrane panels in low volumes for reasonable
prices. And can build for high reliability and high usage at the same
time. 

Also consider small non-seal switches behind a vinyl membrane. The vinyl
can be formed with a bellows that helps feel the switch boundaries and
add flex for reliability and longer throw of your selected switch.

-- 
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

I2C Communicaton via Codevison

2008-03-19 by Benny Smith

I have written a short program using the Codevision AVR C-compiler (version
1.25.8a) to communicate between an ATMega128 and an electronic compass chip
using the I2C (inter-integrated-circuit) functions in Codevision.

 

So far, no luck.  I have followed the example shown in the CV-AVR Help file.
Using an oscilloscope, I do not see any activity at either of the Mega128
ports that I have designated for I2C communication.

 

Has anyone else used the Codevision compiler's I2C functions and been
successful?

 

I have described my problem in an email to Pavel Haiduc at HPInfoTech
(author of Codevision) but he has not yet responded.

 

Benny Smith

Santa Rosa, CA

_._,___ 



[Non-text portions of this message have been removed]

Re: [AVR-Chat] I2C Communicaton via Codevison

2008-03-19 by David Kelly

On Wed, Mar 19, 2008 at 11:54:07AM -0700, Benny Smith wrote:
>  
> So far, no luck.  I have followed the example shown in the CV-AVR Help
> file.  Using an oscilloscope, I do not see any activity at either of
> the Mega128 ports that I have designated for I2C communication.

Start by re-re-re-reading the documentation for the code you are using.
Pay particular attention to initialization. Who is responsible for
setting the port data direction bits, you or the code module?

-- 
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

Re: [AVR-Chat] Re: switch ratings

2008-03-19 by Roy E. Burrage

Try these ones Steven:

       http://www.mouser.com/catalog/633/1598.pdf

With these you can even use a less expensive, non-sealed switch so your 
cost will be a wash.  However, compare the cost of one service call to 
the cost of a few seals and you may gain a whole nuther perspective on 
up front dollars.  We've been using these for several years with no 
problems.


REB


Steven Hodge wrote:
> Well, once again this forum is a wealth of valuable information.   You all
> have brought up a problem I may have at the other end of the spectrum.  I
> have a switch panel, in use now for over 5 years, that can be exposed to the
> environment, ie, occasional rain or splashing (but not dunking).   I am
> using sealed toggle switches, two brands, NKK series WT, and  Honeywell
> 1NT1.   The switches were chosen strictly for this sealed aspect and carry
> some current when closed, 20 to 300 mA depending on the switch.   The NKK
> contacts are rated at 10 A at 30 VDC and the 1NT at 20 A at 28 VDC, way
> overkill but that's all I could find in sealed switches.
>
>  
>
> However, I am switching over to a uC system and now want these switches to
> just supply a logic signal, 3V level.  After the responses to my original
> post I checked the specs on the switches.  The NKK have parts which are
> various combinations of copper and silver, but no gold.  The Honeywell data
> sheet says "Honeywell MICRO SWITCH does not recommend the use of silver
> cadmium oxide switch contacts in non-arcing loads. Non-arcing loads are
> generally loads less than 12 volts and/or 0.5 amp. NT switches use silver
> cadmium oxide contacts."   This is interesting because even my original use
> of them (12V, 20 to 300 mA) does not meet this spec but nonetheless the
> switches have worked fine for 5 years, and continue to do so.  Neither data
> sheet specifically specifies a minimum, or wetting, current.
>
>  
>
> Anyway, my new use of the switches will be much less current.  As the uC
> circuit is right now I am using external 35K pull-ups, a value chosen to be
> roughly the same as the internal pull-ups in the Atmel uC.  This implies a
> current when closed of about 86 uA.  So the problems you all mention could
> now arise.  
>
>  
>
> So what are my options?  They seem pretty limited, perhaps non-existent.  I
> have  tried looking for gold contact switches that are also sealed but came
> up with zilch.   It looks like the only gold contact switches available are
> for protected environments.   I would also have to have a new panel made as
> the existing switches use 15/32" holes.
>
>  
>
> Would the fact the switches are sealed prevent residue from forming?   (The
> Honeywell data sheet seems to imply the answer is no.)
>
>  
>
> If a problem arises with a switch, ie, it ceases to give a logic signal,
> could I open the panel up and "restore" the switch by making it temporarily
> make/break a current near its maximum rating?  Would the arcing break up the
> residue enough to get the switch working again?
>
>  
>
> What about putting a capacitor across the switch, without any resistor, to
> force arcing to occur every time the switch is used?
>
>  
>
> Does someone know a source of low current switches that are sealed and can
> be exposed to the environment?   I suppose a mercury type switch would work
> but I've only been able to find those as tilt switches, so couldn't be used
> in a fixed panel mount.
>
>  
>
> Steve
>
>  
>
> PS.  Incidentally, during my research I found a table on the NKK website,
> http://www.nkkswitches.com/pdf/electricalratings.pdf, that allows one to
> calculate a rating for conditions other than specified.   The table gives a
> factor of 1.25 for 12 VDC relative to a switch rated at 30 VDC.   Thus a 4
> A/30 VDC switch could use up to 5 A at 12 VDC.  Not relevant here but is
> relevant to my original post.
>
>  
>
> From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
> Of Roy E. Burrage
> Sent: Tuesday, March 18, 2008 6:23 PM
> To: AVR-Chat@yahoogroups.com
> Subject: Re: [AVR-Chat] Re: switch ratings
>
>  
>
> It looks like this application is handled, Steven. You might also want 
> to keep the following in mind for future apps:
>
> Silver alloys are fine for "power" applications but they're severely 
> limited when you get down in the mud with really low currents because 
> the contacts will build up an oxide or a sulfide coating. This is why 
> they depend on the small amount of arcing that will occur in a power 
> circuit. At low currents, such as driving a logic input, you'll need 
> gold inlay or a gold flask over silver contacts. The same holds true 
> for relays. Be sure to9 look at the minimum current ratings for 
> switching devices. There's also a difference between switching current 
> and carrying current capacities.
>
> Voice of experience...don't ever try to drive a logic input with the 
> auxiliary contacts of a motor starter.
>
> REB
>
> Steven Hodge wrote:
>   
>> Thanks for all your input. Got it. I'll use the 28 VDC rating for 12 v.
>> I need to make/break 3.5A so I'll have to switch (pun intended) to a
>>     
> switch
>   
>> rated at 4 A at 28 VDC instead of the 3 A one I was hoping to use (for
>> aesthetic compatibility with adjacent switches). Steve
>>
>>
>>
>>     
>
>
>
>  
>
>
>
> [Non-text portions of this message have been removed]
>
>
> ========================================================================
> Groups related to AVR-Chat		                       	
> ========================================================================
>
> avrclub (829 common members)           
> http://groups.yahoo.com/group/avrclub?v=1&t=ipt&ch=email&pub=groups&slk=aftr0&sec=recg  
> Microprocessors/Microcontrollers: Atmel AVR Microcontroller discussion group!
>
> e-embedded (324 common members)           
> http://groups.yahoo.com/group/e-embedded?v=1&t=ipt&ch=email&pub=groups&slk=aftr1&sec=recg  
> Internet/Internet Appliances: Open-membership mailing list for embedded system d...
>
> piclist (280 common members)           
> http://groups.yahoo.com/group/piclist?v=1&t=ipt&ch=email&pub=groups&slk=aftr2&sec=recg  
> Microprocessors/Microcontrollers: A discussion group for the PICMicro microcontrolle...
>
> booksbybibin (193 common members)           
> http://groups.yahoo.com/group/booksbybibin?v=1&t=ipt&ch=email&pub=groups&slk=aftr3&sec=recg  
> Mechanical/Robotics: This groups contains the books for robotics,parall...
>
> Homebrew_PCBs (190 common members)           
> http://groups.yahoo.com/group/Homebrew_PCBs?v=1&t=ipt&ch=email&pub=groups&slk=aftr4&sec=recg  
> Engineering/Electrical: Designing, making, etching, soldering, printed cir...
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
>
>   


[Non-text portions of this message have been removed]

RE: [AVR-Chat] I2C Communicaton via Codevison

2008-03-19 by Benny Smith

David,

 

Thanks for the reply.

 

The i2c functions in Codevision-AVR-Standard are not located in a library
file, so I cannot look at them to figure out whether data direction is
handled there.

 

The i2c functions are embedded in the main CV-AVR compiler (according to the
Pavel Haiduc) and are called as necessary during compilation.

 

The documentation of these functions is scant, and limited to just what is
in the Help file. The i2c Help file mentions nothing about data direction
nor does it say anything about initialization of the AVR.

 

There is a function called "i2c_init()" , which the Help file documents as
follows:

-----------------------------------------------

void i2c_init(void)

 

this function initializes the I2C bus.

This is the first function that must be called prior to using the other I2C
Functions.

 

 

Again, no mention of initialization or data direction for port pins.

 

Also, in the Help-file, there is an example of how to use the i2c functions
to write to and read from an external EEPROM.  This code example includes an
assembly language snippet that assigns aliases for the AVR port to be used
for i2c and the specific port pins for SDA and SCL signals.  But, no data
direction for those pins.

 

Here is the snippet:

 

asm

    .equ __i2c_port=0x18;  set PORTB of Mega 128 as i2c port

    .equ __sda_bit=3

    .equ __scl_bit=2

#endasm

 

 

It will do no harm to insert a DDR statement for PORTB in my code to see
whether that is the problem.

 

I'll try it.

 

Benny
Show quoted textHide quoted text
-----Original Message-----
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of David Kelly
Sent: Wednesday, March 19, 2008 2:19 PM
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] I2C Communicaton via Codevison

 

On Wed, Mar 19, 2008 at 11:54:07AM -0700, Benny Smith wrote:
> 
> So far, no luck. I have followed the example shown in the CV-AVR Help
> file. Using an oscilloscope, I do not see any activity at either of
> the Mega128 ports that I have designated for I2C communication.

Start by re-re-re-reading the documentation for the code you are using.
Pay particular attention to initialization. Who is responsible for
setting the port data direction bits, you or the code module?

-- 
David Kelly N4HHE, dkelly@HiWAAY. <mailto:dkelly%40HiWAAY.net> net
========================================================================
Whom computers would destroy, they must first drive mad.

 



[Non-text portions of this message have been removed]

Re: [AVR-Chat] I2C Communicaton via Codevison

2008-03-20 by David Kelly

On Mar 19, 2008, at 5:52 PM, Benny Smith wrote:

[...]

> The documentation of these functions is scant, and limited to just  
> what is
> in the Help file. The i2c Help file mentions nothing about data  
> direction
> nor does it say anything about initialization of the AVR.

Thats why I hate canned code. CodeVision's trademark feature is this  
sort of hand holding.

Heck, until recently I used my own EEPROM access routines rather than  
use those provided in avr-libc. Still use my own UART and SPI code.  
Easier to write my own than to understand and/or conform to what  
others did.

> There is a function called "i2c_init()" , which the Help file  
> documents as
> follows:

Linking with other threads, "do you have a debugger?" Set a breakpoint  
before and after i2c_init() and see what the DDR bits look like before  
and after.

--
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

RE: [AVR-Chat] Re: switch ratings

2008-03-21 by Steven Hodge

Thanks for the tip.  I'll give them a try.  Steve
Show quoted textHide quoted text
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of Roy E. Burrage
Sent: Wednesday, March 19, 2008 3:43 PM
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] Re: switch ratings

 

Try these ones Steven:

http://www.mouser.com/catalog/633/1598.pdf

With these you can even use a less expensive, non-sealed switch so your 
cost will be a wash. However, compare the cost of one service call to 
the cost of a few seals and you may gain a whole nuther perspective on 
up front dollars. We've been using these for several years with no 
problems.

REB

Steven Hodge wrote:
> Well, once again this forum is a wealth of valuable information. You all
> have brought up a problem I may have at the other end of the spectrum. I
> have a switch panel, in use now for over 5 years, that can be exposed to
the
> environment, ie, occasional rain or splashing (but not dunking). I am
> using sealed toggle switches, two brands, NKK series WT, and Honeywell
> 1NT1. The switches were chosen strictly for this sealed aspect and carry
> some current when closed, 20 to 300 mA depending on the switch. The NKK
> contacts are rated at 10 A at 30 VDC and the 1NT at 20 A at 28 VDC, way
> overkill but that's all I could find in sealed switches.
>
> 
>
> However, I am switching over to a uC system and now want these switches to
> just supply a logic signal, 3V level. After the responses to my original
> post I checked the specs on the switches. The NKK have parts which are
> various combinations of copper and silver, but no gold. The Honeywell data
> sheet says "Honeywell MICRO SWITCH does not recommend the use of silver
> cadmium oxide switch contacts in non-arcing loads. Non-arcing loads are
> generally loads less than 12 volts and/or 0.5 amp. NT switches use silver
> cadmium oxide contacts." This is interesting because even my original use
> of them (12V, 20 to 300 mA) does not meet this spec but nonetheless the
> switches have worked fine for 5 years, and continue to do so. Neither data
> sheet specifically specifies a minimum, or wetting, current.
>
> 
>
> Anyway, my new use of the switches will be much less current. As the uC
> circuit is right now I am using external 35K pull-ups, a value chosen to
be
> roughly the same as the internal pull-ups in the Atmel uC. This implies a
> current when closed of about 86 uA. So the problems you all mention could
> now arise. 
>
> 
>
> So what are my options? They seem pretty limited, perhaps non-existent. I
> have tried looking for gold contact switches that are also sealed but came
> up with zilch. It looks like the only gold contact switches available are
> for protected environments. I would also have to have a new panel made as
> the existing switches use 15/32" holes.
>
> 
>
> Would the fact the switches are sealed prevent residue from forming? (The
> Honeywell data sheet seems to imply the answer is no.)
>
> 
>
> If a problem arises with a switch, ie, it ceases to give a logic signal,
> could I open the panel up and "restore" the switch by making it
temporarily
> make/break a current near its maximum rating? Would the arcing break up
the
> residue enough to get the switch working again?
>
> 
>
> What about putting a capacitor across the switch, without any resistor, to
> force arcing to occur every time the switch is used?
>
> 
>
> Does someone know a source of low current switches that are sealed and can
> be exposed to the environment? I suppose a mercury type switch would work
> but I've only been able to find those as tilt switches, so couldn't be
used
> in a fixed panel mount.
>
> 
>
> Steve
>
> 
>
> PS. Incidentally, during my research I found a table on the NKK website,
> http://www.nkkswitches.com/pdf/electricalratings.pdf, that allows one to
> calculate a rating for conditions other than specified. The table gives a
> factor of 1.25 for 12 VDC relative to a switch rated at 30 VDC. Thus a 4
> A/30 VDC switch could use up to 5 A at 12 VDC. Not relevant here but is
> relevant to my original post.
>
> 
>
> From: AVR-Chat@yahoogroups.com <mailto:AVR-Chat%40yahoogroups.com>
[mailto:AVR-Chat@yahoogroups.com <mailto:AVR-Chat%40yahoogroups.com> ] On
Behalf
> Of Roy E. Burrage
> Sent: Tuesday, March 18, 2008 6:23 PM
> To: AVR-Chat@yahoogroups.com <mailto:AVR-Chat%40yahoogroups.com> 
> Subject: Re: [AVR-Chat] Re: switch ratings
>
> 
>
> It looks like this application is handled, Steven. You might also want 
> to keep the following in mind for future apps:
>
> Silver alloys are fine for "power" applications but they're severely 
> limited when you get down in the mud with really low currents because 
> the contacts will build up an oxide or a sulfide coating. This is why 
> they depend on the small amount of arcing that will occur in a power 
> circuit. At low currents, such as driving a logic input, you'll need 
> gold inlay or a gold flask over silver contacts. The same holds true 
> for relays. Be sure to9 look at the minimum current ratings for 
> switching devices. There's also a difference between switching current 
> and carrying current capacities.
>
> Voice of experience...don't ever try to drive a logic input with the 
> auxiliary contacts of a motor starter.
>
> REB
>
> Steven Hodge wrote:
> 
>> Thanks for all your input. Got it. I'll use the 28 VDC rating for 12 v.
>> I need to make/break 3.5A so I'll have to switch (pun intended) to a
>> 
> switch
> 
>> rated at 4 A at 28 VDC instead of the 3 A one I was hoping to use (for
>> aesthetic compatibility with adjacent switches). Steve
>>
>>
>>
>> 
>
>
>
> 
>
>
>
> [Non-text portions of this message have been removed]
>
>
> ========================================================================
> Groups related to AVR-Chat 
> ========================================================================
>
> avrclub (829 common members) 
> http://groups.yahoo.com/group/avrclub?v=1
<http://groups.yahoo.com/group/avrclub?v=1&t=ipt&ch=email&pub=groups&slk=aft
r0&sec=recg> &t=ipt&ch=email&pub=groups&slk=aftr0&sec=recg 
> Microprocessors/Microcontrollers: Atmel AVR Microcontroller discussion
group!
>
> e-embedded (324 common members) 
> http://groups.yahoo.com/group/e-embedded?v=1
<http://groups.yahoo.com/group/e-embedded?v=1&t=ipt&ch=email&pub=groups&slk=
aftr1&sec=recg> &t=ipt&ch=email&pub=groups&slk=aftr1&sec=recg 
> Internet/Internet Appliances: Open-membership mailing list for embedded
system d...
>
> piclist (280 common members) 
> http://groups.yahoo.com/group/piclist?v=1
<http://groups.yahoo.com/group/piclist?v=1&t=ipt&ch=email&pub=groups&slk=aft
r2&sec=recg> &t=ipt&ch=email&pub=groups&slk=aftr2&sec=recg 
> Microprocessors/Microcontrollers: A discussion group for the PICMicro
microcontrolle...
>
> booksbybibin (193 common members) 
> http://groups.yahoo.com/group/booksbybibin?v=1
<http://groups.yahoo.com/group/booksbybibin?v=1&t=ipt&ch=email&pub=groups&sl
k=aftr3&sec=recg> &t=ipt&ch=email&pub=groups&slk=aftr3&sec=recg 
> Mechanical/Robotics: This groups contains the books for robotics,parall...
>
> Homebrew_PCBs (190 common members) 
> http://groups.yahoo.com/group/Homebrew_PCBs?v=1
<http://groups.yahoo.com/group/Homebrew_PCBs?v=1&t=ipt&ch=email&pub=groups&s
lk=aftr4&sec=recg> &t=ipt&ch=email&pub=groups&slk=aftr4&sec=recg 
> Engineering/Electrical: Designing, making, etching, soldering, printed
cir...
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>
>
> 

[Non-text portions of this message have been removed]

 

__________ NOD32 2960 (20080319) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



[Non-text portions of this message have been removed]

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.