Software > Software


(1/2) > >>

ok i read a little part of the sheet (info of the chip) so now i wanted to ask what the ports of the atmega16l are for (B7 / B0 for example) in plain english (so even a total noob can understand it)


--- Quote ---Port B is an 8-bit bidirectional I/O port with internal pull-up resistors (selected for each
bit). The Port B output buffers have symmetrical drive characteristics with both high sink
and source capability. As inputs, Port B pins that are externally pulled low will source
current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset
condition becomes active, even if the clock is not running.
Port B also serves the functions of various special features of the ATmega16 as listed
on page 58.
--- End quote ---

You want this to be translated? Or the functions listed on page 58?

Ok, I'll try to translate this and maybe later the functions.

The first sentence states that Port B is basically an 8 bit or 1 byte port that can be set as input or output. It also state that it has internal pull-up resistors selectable for all or each bit (pin).
The second sentence states that used as output, Port B has buffers that can source (provide current, like connecting something to power) or sink (absorb current, like connecting something to ground).
The third sentence warns you that when used as input, Port B pins that are connected externally to the ground (directly or through a resistor) and have the internal pull-up resistor activated will have a current going towards the ground (directly or through the resistor). This is a waste of power, bad for a robot.
The fourth sentence states that Port B pins will be disconnected from the circuit (state Z, high impedance) when the reset pin will be triggered (usually pulled low - connected to the ground). More about tri-state on the link below:

Does this help?

ik this helps thks :p

just a question is it possible to set a pin of portb to in and another one of portb to out

It depends on the definitions of the channels. Generally, yes you can set one channel to INPUT only while the other is OUTPUT only.

Open the data sheet of the part (ATmega8, ATtiny13, etc) that you are using then find "Alternate Functions of Port X". This section will give you the definitions of the functionality of Port "X", some channels are INPUT only some are OUTPUT only, some have dual roles, able to become INPUT or OUTPUT. Common sense dictates that you can not set an INPUT only channel to OUTPUT.


[0] Message Index

[#] Next page

Go to full version