Forum: Mikrocontroller und Digitale Elektronik UART1 ATMEGA128


von Andreas (Gast)


Lesenswert?

Hallo leute ich benutze die Uart - Lib von Peter Fleury... der
controller läuft und sendet... der Max 232 ist auf jeden fall richtig
angeschlossen. kann mir vielleicht jemand sagen was ich falsch mache ?


int main(void)
{
    char buff[20];
  int loop=0;
  sbi (DDRD,3); // set TxD1 as output
  cbi (DDRD,2); // set RxD1 as input
  sbi (DDRG,4); // set Port G 4 as output for mainloop alive
  sbi(PORTG,4);
  uart1_init(38400); // init uart 1 baudrate 38400
  sei();             // general interrupts enable
  while(1)
  {
  loop++;
  if(loop>0xFFFE)
    {
    PORTG ^= _BV(PG4);
    loop=0;
    sprintf(buff," 1 2 3 4 Hallo Welt");
    uart1_puts(buff);
    }
  }
}

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.