Yahoo Groups archive

AVR-Chat

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

Thread

help/reading I/0 pins

help/reading I/0 pins

2005-08-09 by aswinefy2003

Hello

         Can any one give a sample code for 
 reading the value of  a i/o PIN. Also tell 
me role of pull up resistor in doiing so.

RE: [AVR-Chat] help/reading I/0 pins

2005-08-09 by wbounce

Read the data sheet for your part 
But this is my understanding.

Working with port B

Set port B to output and output a logical high to pin 0
DDRB = 0xFF;
PORTB |= 1;

Set port B pin 0 to input with pullup register on
PORTB |= 1;
DDRB = 0xFE;

Set port B pin 0 to input with pullup register off
PORTB |= 1;
DDRB = 0xFF;


Read port B pin 0

Myvar = (PINB & 1); 


Summary
Set DDRB to 1 for output 0 for input
For input write a 1 to that pin to enable pullup 0 to disable pullup
The PINB can be used to read the port at anytime. 

Hope this helps
Show quoted textHide quoted text
-----Original Message-----
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On
Behalf Of aswinefy2003
Sent: Tuesday, August 09, 2005 12:40 AM
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] help/reading I/0 pins


Hello

         Can any one give a sample code for 
 reading the value of  a i/o PIN. Also tell 
me role of pull up resistor in doiing so.       








 
Yahoo! Groups Links

RE: [AVR-Chat] help/reading I/0 pins

2005-08-09 by Thomas Keller

On Tue, 2005-08-09 at 10:07 -0400, wbounce wrote:
> Read the data sheet for your part 
> But this is my understanding.
> -----Original Message-----

>          Can any one give a sample code for 
> reading the value of  a i/o PIN. Also tell 
> me role of pull up resistor in doiing so.     \

As wbounce wrote, read the data sheet.


  As for the role of the pullup resistors:

Pullup resistors lock the value of the input pin to a known value (Vcc,
or logic 0 in this case).  This is to insure that a pin connected to a
tri-stated output from another chip doesn't read a false logic 1 because
the tri-state voltage is above .5 Vcc.  It is essentially a
safety/reliability issue.

   When you pull the pulled-up pin low, the Vcc drops across the pullup
resisotr, but allows the voltage at the pin itself to drop to ground
(very nearly 0 V).  

   Because the pullup resisots are integrated into the AVR chip, you
don't need to worry about values.  In general, pullup resistors want to
be between 4.7K amd 15K ohms.  This is to minimize the current drawn
through the pullup resisotor, which current otherwise represents wasted
energy and added heat (a very serious issue for portable, low-power
electronics).  Typically, larger values of pullup resistors have been
found to lead to problems with stray RF pickup causing erroneous signals
at the input pins, so they are to be avoided.  Smaller values result in
excessive heat geenration and power dissipation.  When using discrete,
external pullup resistors, the resistors should be mounted as close to
the chiup package as possible, with the shortest traces possible between
the pullup resistor and the package pin.  Again, this is to avoid RF and
other EMI interfereing with the correct operation of the circuit.


tom

44 (and 32 ) pin TQFP ZIF socket?

2005-08-09 by Peter Gargano

I have a lot of Mega-16 chips in TQFP 44 pin package that I want to 
program (before soldering them into a board).

The programmer is not a problem (STK500 or AVRISP), but what do I use 
to physically connect to the chip for programming? I guess I'm after a 
TQFP ZIP socket.

Peter





















te.

Re: [AVR-Chat] 44 (and 32 ) pin TQFP ZIF socket?

2005-08-10 by Henry Carl Ott

At 07:38 PM 8/9/2005, you wrote:
>I have a lot of Mega-16 chips in TQFP 44 pin package that I want to
>program (before soldering them into a board).
>
>The programmer is not a problem (STK500 or AVRISP), but what do I use
>to physically connect to the chip for programming? I guess I'm after a
>TQFP ZIP socket.
>
>Peter
>


     Not sure how many is a lot, but.....
     If you already have a stk500 perhaps a stk501?

      Not the cheapest, but maybe the simplest.
     Then you also have the stk501 around for development.

      ISP can be handier if you have the room on your board (future designs).


-carl

RE: [AVR-Chat] 44 (and 32 ) pin TQFP ZIF socket?

2005-08-10 by OWEN-A

The STK501 top module has a 64 pin socket not a 44 pin.
Owen.


     Not sure how many is a lot, but.....
     If you already have a stk500 perhaps a stk501?

      Not the cheapest, but maybe the simplest.
     Then you also have the stk501 around for development.

      ISP can be handier if you have the room on your board (future
designs).


-carl




 
Yahoo! Groups Links

Re: [AVR-Chat] 44 (and 32 ) pin TQFP ZIF socket?

2005-08-10 by Kathy Quinlan

Peter Gargano wrote:

> I have a lot of Mega-16 chips in TQFP 44 pin package that I want to 
> program (before soldering them into a board).
> 
> The programmer is not a problem (STK500 or AVRISP), but what do I use 
> to physically connect to the chip for programming? I guess I'm after a 
> TQFP ZIP socket.
> 
> Peter

Simple Solution, if you use the programming lines (and they are outputs 
with a high impedance load, or inputs with a high impedance source) then 
solder the chips on, take a spare PCB (or make one) drill the holes out 
to suit some pointed bed of nails probes, and then just put the PCB's 
with just the CPU (xtal and caps) on the bed of nails and program away, 
it is how I do tight designs where I can not get space for a connector 
(I just leave so sacrificial pads on the bottom or top for programming)

Regards,

Kat.



-- 
---------------------------------------------------------------
K.A.Q. Electronics	Website: www.kaqelectronics.dyndns.org
IM: Yahoo: PinkyDwaggy  MSN: katinka@kaqelectronics.dyndns.org
For Everything Electronics     Phone: 0419 923 731
---------------------------------------------------------------	


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.10.5/67 - Release Date: 9/08/2005

RE: [AVR-Chat] 44 (and 32 ) pin TQFP ZIF socket?

2005-08-10 by Henry Carl Ott

At 11:00 PM 8/9/2005, you wrote:
>The STK501 top module has a 64 pin socket not a 44 pin.
>Owen.
>
>
>      Not sure how many is a lot, but.....
>      If you already have a stk500 perhaps a stk501?


  Argh, my bad, Thought the OP was asking about m128s.
  Please disregard.

  Hmmm, but now that the subject is breached, a 44 pin zif might be handy 
for those mega8 projects....

   -carl

Re: [AVR-Chat] 44 (and 32 ) pin TQFP ZIF socket?

2005-08-10 by Peter Gargano

Peter Gargano wrote:
> I have a lot of Mega-16 chips in TQFP 44 pin package that I want to 
> program (before soldering them into a board).

A lot is 100 or more

> The programmer is not a problem (STK500 or AVRISP), but what do I use 
> to physically connect to the chip for programming? I guess I'm after a 
> TQFP ZIP socket.

I guess I didn't make it clear that I wanted something that would let 
me program TQFP chips by either removing them from the "racks" they 
come in and inserting them into a zero insertion force (ZIF) "carrier" 
that would itself be connected to something like an STK500.

Soldering anything to the unprogrammed TQFP chips isn't an option.

What we do now is hold the chip by hand onto a proto PCB that we have. 
This is hardly a reliable solution, and is more time consuming than 
necessary.

Another solution is to have a "socket" that is slotted into the 
individual carrier the chips come in. Given enough time I'm sure I 
could engineer a one-off solution, but time is not on my side at the 
moment.

These people ..

   http://www.yamaichi.com/

seem to have solutions but their web site is so badly organised, and 
their engineering drawings so bad, that I'm not sure what they really 
sell, but some other people who make socket adapters use Yamaichi parts.

Peter













te.

Re: [AVR-Chat] 44 (and 32 ) pin TQFP ZIF socket?

2005-08-10 by William LAI

I'm using an adaptor to program the chip before
soldering.  A similar one is Xeltek A011 which is
selling at Digikey at $225.  I may help you to source
a cheaper one if you need.

William Lai
MCU ProShop
http://www.mcuproshop.com


--- Peter Gargano <peter@techedge.com.au> wrote:

> Peter Gargano wrote:
> > I have a lot of Mega-16 chips in TQFP 44 pin
> package that I want to 
> > program (before soldering them into a board).
> 
> A lot is 100 or more
> 
> > The programmer is not a problem (STK500 or
> AVRISP), but what do I use 
> > to physically connect to the chip for programming?
> I guess I'm after a 
> > TQFP ZIP socket.
> 
> I guess I didn't make it clear that I wanted
> something that would let 
> me program TQFP chips by either removing them from
> the "racks" they 
> come in and inserting them into a zero insertion
> force (ZIF) "carrier" 
> that would itself be connected to something like an
> STK500.
> 
> Soldering anything to the unprogrammed TQFP chips
> isn't an option.
> 
> What we do now is hold the chip by hand onto a proto
> PCB that we have. 
> This is hardly a reliable solution, and is more time
> consuming than 
> necessary.
> 
> Another solution is to have a "socket" that is
> slotted into the 
> individual carrier the chips come in. Given enough
> time I'm sure I 
> could engineer a one-off solution, but time is not
> on my side at the 
> moment.
> 
> These people ..
> 
>    http://www.yamaichi.com/
> 
> seem to have solutions but their web site is so
> badly organised, and 
> their engineering drawings so bad, that I'm not sure
> what they really 
> sell, but some other people who make socket adapters
> use Yamaichi parts.
> 
> Peter
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> te.
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com

Re: [AVR-Chat] 44 (and 32 ) pin TQFP ZIF socket?

2005-08-10 by Bruce Parham

Peter Gargano wrote:

> I have a lot of Mega-16 chips in TQFP 44 pin package that I want to 
> program (before soldering them into a board).
> 
> The programmer is not a problem (STK500 or AVRISP), but what do I use 
> to physically connect to the chip for programming? I guess I'm after a 
> TQFP ZIP socket.
> 
> Peter


Yamaichi seems to make the best parts though not cheep. For example, the
64-pin socket on the STK501 sells for around $100 in small quantities. (And
that is the reason you can't buy a '501 unless you buy a '500 too.)

Found in Altera app note AN80 Jan 1999:

   Socket          Because QFP packages are more susceptible to lead
   Evaluation for  deformation,production sockets must be rigorously
   QFP Packages    qualified. Altera recommends using a burn-in socket
                   for QFP packages because of the socket’s reliability.
                   While sockets should always be qualified, Table 5
                   suggests sockets based on the number of pins and type
                   of QFP package.


   Table 5. Socket Vendor Information for QFP Packages

   Package Type                    Pins    Vendor       Part Number
   Thin quad flat pack (TQFP)       32    Yamaichi     IC51-0324-1498
   Plastic quad flat pack (PQFP)    44    Yamaichi     IC51-467-KS11258
   TQFP                             44    Yamaichi     IC51-0444-1568
   PQFP                            100    Yamaichi     IC51-1004-814-2
   Ceramic quad flat pack (CQFP)   100    Yamaichi     IC51-1004-814-2
   TQFP                            100    Yamaichi     IC51-1004-809
   PQFP                            132    Yamaichi     IC51-1324-828
   TQFP                            144    Yamaichi     IC51-1444-1354-7
   PQFP                            160    Yamaichi     IC51-1604-845-4
   PQFP                            208    Yamaichi     IC51-2084-1052-11
   Power quad flat pack (RQFP)     208    Yamaichi     IC51-2084-1052-11
    (square heat sink)
   RQFP (round heat sink)          208    Yamaichi     IC51-1052KS-13087
   CQFP                            208    Yamaichi     IC51-1509-KS14057
   RQFP (square heat sink)         240    Yamaichi     IC51-1655KS-13666
   RQFP (round heat sink)          240    Yamaichi     IC51-2404-1655-2
   RQFP                            304    Yamaichi     IC51-3044-1471-2

Here's a link to the Yamaichi data sheet:

     http://www.yamaichi.de/pdf/tb_qfp_gullwing.pdf

I don't know which dist's carry these buy a bit o' Google should show the way.

Good luck.

Bruce

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.