Gast
#181337
hallo hab ein kleines problem! müsste die pull-up-widerstände von den ports deaktivieren! kann mir das jemand erklären? mfg.fabian
|
Anzeige
|
CV-AVR probleme -deaktivierung von pull-up widerstände
Gast
#181337
hallo hab ein kleines problem! müsste die pull-up-widerstände von den ports deaktivieren! kann mir das jemand erklären? mfg.fabian
Gast
#181338
Bei gcc-avr get das so PORTx = 0;
Gast
#181339
Steht in jedem Datenblatt: Hier ein Beispiel für einen PortB: PBn, General I/O pin: The DDBn bit in the DDRB register selects the direction of this pin, if DDBn is set (one), PBn is configured as an output pin. If DDBn is cleared (zero), PBn is configured as an input pin. If PORTBn is set (one) when the pin configured as an input pin, the MOS pull up resistor is activated. To switch the pull up resistor off, the PORTBn has to be cleared (zero) or the pin has to be configured as an output pin The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not active. Also für einen Input: PORTB &= ~_BV(PB0); // Pull up aus für PB0 DDRB &= _BV(DDB0); // PB0 ist input oder für einen Output: PORTB &= ~_BV(PB0); // Pull up aus für PB0 DDRB |= _BV(DDB0); // PB0 is output Reiner Antwort schreiben |
Anzeige
|