Vom laufenden Programm aus kann man das ROM normalerweise nur lesen, nicht beschreiben. Es kann beliebig oft gelesen und mindestens Bei den AVRs kann man es z. Nun sollen aber auch vom laufenden Programm aus Daten ausgelesen werden. Um die Daten wieder auszulesen, muss man die Adresse, auf die zugegriffen werden soll, in den Z-Pointer laden. Wenn die richtige Adresse erstmal im Z-Pointer steht, geht das eigentliche Laden der Daten ganz einfach mit dem Befehl lpm.
|Published (Last):||2 April 2010|
|PDF File Size:||10.35 Mb|
|ePub File Size:||6.47 Mb|
|Price:||Free* [*Free Regsitration Required]|
Remember, a port has multiple pins. Thus in order to change setting for one port, you have to change setting for all port pins of that port. To change setting for one single pin of the port, you have to change a particular bit in associated register. Got that? If not read this para again.
Registers Atmel AVR is 8 bit microcontroller. All its ports are 8 bit wide. Every port has 3 registers associated with it each one with 8 bits. Every bit in those registers configure pins of particular port.
Bit0 of these registers is associated with Pin0 of the port, Bit1 of these registers is associated with Pin1 of the port, …. Means its setting determines whether port pins will be used for input or output. Writing 0 to a bit in DDRx makes corresponding port pin as input, while writing 1 to a bit in DDRx makes corresponding port pin as output.
This is done by setting bits in DDRx to zero. If port is made output, then reading PINx register will give you data that has been output on port pins. Now there are two input modes. Either you can use port pins as tri stated inputs or you can activate internal pull up. It will be explained shortly. Example : to read data from port A. Now you can write data into respective bits in PORTx register.
This will immediately change state of output pins according to data you have written. In other words to output data on to port pins, you have to write it into PORTx register.
However do not forget to set data direction as output. In order to activate pull-up resister, set bit in PORTx to 1, and to deactivate i. Now, when you externally drive that pin to zero i. However, if you configure pin as tri-state. Then pin goes into state of high impedance. We can say, it is now simply connected to input of some OpAmp inside the uC and no other circuit is driving it from uC.
Thus pin has very high impedance. In this case, if pin is left floating i. If you try to read corresponding bit in pin register, its state cannot be predicted. This may cause your program to go haywire, if it depends on input from that particular pin.
ATMEGA162-16PU Atmel, ATMEGA162-16PU Datasheet
Remember, a port has multiple pins. Thus in order to change setting for one port, you have to change setting for all port pins of that port. To change setting for one single pin of the port, you have to change a particular bit in associated register. Got that? If not read this para again. Registers Atmel AVR is 8 bit microcontroller. All its ports are 8 bit wide.
Atmega162-16au Atmel ATMEGA 162 AVR Controller Tqfp44
The product detailed below complies with the specifications published by RS Components. Get fast, free shipping with Amazon Prime. A complete starter kit and development system for the 8-bit and bit AVR microcontrollers that gives designers a quick start to develop code on the AVR, with advanced features for prototyping and atmega16 new designs. Maximum Number of Ethernet Channels.