Programmierproblem SiLabs C8051F300

Gast #1353535
Lesenswert?

Hallo.

Ich möchte einen SiLabs C8051F300 in C programmieren.
Ich hab den WDT deaktiviert, alle Pins initialisiert und den internen 
Oszillator eingestellt. Ich möchte zuerst mal nur einen Ausgang aus bzw 
einschalten, bisher leider ohne Erfolg. hat jemand eine Idee woran es 
leigen könnte.
***

#include <c8051f300.h>

sbit Taster  = P0^5;
sbit LED1   = P0^0;
sbit LED2   = P0^3;

void OSCILLATOR_Init(void);
void PORT_Init(void);

void main(void)
{
  OSCILLATOR_Init();
  PORT_Init();
  LED1 = 1;
  LED2 = 0;
  P0 = 0x41;
}

void OSCILLATOR_Init(void)
{
  OSCICN  =  0x04;  //internal Oscillator, lowest frequency
}


void PORT_Init (void)
{
  P0MDIN   = 0xEF;  // Select P0.4 as analog input
  P0MDOUT = 0x45;  // Select p0.6, P0.0 und 0.3 as push-pull output
  XBR0  = 0x10;  // P0.4(ADC) is skipped by the crossbar
  XBR1  = 0x00;  // keine special Functions on Pin available
  XBR2  = 0x40;  // enable crossbar and weak pull-ups
  PCA0MD  = 0x00;  // Watchdog Timer deaktivieren
}

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