rs232 übertragungs Problem PIC F877

Gast #2963303
Lesenswert?

Hallo,
ich habe ein komisches Problem. Ich möchte gerne mit dem PIC über die 
RS232 schnittstelle die BIT Folge 808080800D ausgeben.Als 
Übertragungrate habe ich 9600 Baud, 1 Stopbit,Parity none.
Wenn ich den Prozessor an ein Terminal anschliesse wird mir das auch 
ohne Probleme angezeit. Mess ich mit dem Oszi, kommt nur Müll raus.
Kann mir da jemand helfen?

#include <16F887.h>

//Compiler Directives 
------------------------------------------------------------------------ 
-
#FUSES NOWDT                   //No Watch Dog Timer
#FUSES XT                      //External XTAL
#FUSES NOPUT                   //No Power Up Timer
#FUSES NOPROTECT               //Code not protected from reading
#FUSES NODEBUG                 //No Debug mode for ICD
#FUSES NOBROWNOUT              //No brownout reset
#FUSES NOLVP                   //No low voltage prgming, B3(PIC16) or 
B5(PIC18) used for I/O
#FUSES NOCPD                   //No EE protection
#FUSES NOWRT                   //Program memory not write protected

#use delay(clock=4000000)
#use rs232(baud=9600,parity=n,bits=8,stop=1,xmit=pin_c6,RCV=pin_c7)

#define IN_OUT PIN_B0
#define S500 PIN_B1
#define S501 PIN_B2
#define S502 PIN_B3
#define S503 PIN_B4

int data0[5];

void main(void)
{

while(1)
  {
  data0[0]=0x80;
  data0[1]=0x80;
  data0[2]=0x80;
  data0[3]=0x80;
  data0[4]=0x0D;


printf("%x",data0[0]);
delay_ms(1);
printf("%x",data0[1]);
delay_ms(1);
printf("%x",data0[2]);
delay_ms(1);
printf("%x",data0[3]);
delay_ms(1);
printf("%x",data0[4]);

delay_ms(1);


  }
}

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren