Hallo Zusammen, ich nehme gerade meinen Mikrocontroller (PIC18F60K88) in Betrieb. Leider scheitert es schon an den digitalen Ausgängen. Ich will mit folgendem Code die LED's am Port C (RC0 - RC5) aktivieren. Funktioniert für für RC2 - RC5 wudnerbar. An den Pins 48 (=RC0) und 49 (=RC1) tut sich jedoch nichts.
1 | /*********************************************************************
|
2 | * Includes
|
3 | *********************************************************************/
|
4 | #include <xc.h> //XC compiler header file |
5 | #include "p18f66k80.h" |
6 | |
7 | /*********************************************************************
|
8 | * Config Bit Settings
|
9 | *********************************************************************/
|
10 | #pragma config XINST = OFF // Extended instruction set enabled
|
11 | #pragma config FOSC = HS1 // HS1 external oszillator
|
12 | #pragma config PWRTEN = ON // Power up timer enabled
|
13 | #pragma config BOREN = OFF // Brown-out Reset disabled
|
14 | #pragma config WDTEN = OFF // Watch dog timer is always disabled
|
15 | #pragma config MCLRE = ON // MCLR enabled
|
16 | |
17 | /*********************************************************************
|
18 | * Variables
|
19 | *********************************************************************/
|
20 | |
21 | |
22 | /*********************************************************************
|
23 | * Defines
|
24 | *********************************************************************/
|
25 | #define TRUE 1
|
26 | #define FALSE 0
|
27 | #define _XTAL_FREQ 18000000
|
28 | |
29 | |
30 | /*********************************************************************
|
31 | * Function Prototypes
|
32 | *********************************************************************/
|
33 | void initDevice(void); |
34 | |
35 | /*********************************************************************
|
36 | * Initialize the Device
|
37 | *********************************************************************/
|
38 | void initDevice(void) |
39 | {
|
40 | TRISC = 0x00; //RC0 - RC7 als Ausgang |
41 | }
|
42 | |
43 | /*********************************************************************
|
44 | * Main Function
|
45 | *********************************************************************/
|
46 | void main(void) |
47 | {
|
48 | initDevice(); //Init device |
49 | while(1) |
50 | {
|
51 | LATC = 0xff; |
52 | }
|
53 | }
|
Kann mir jemand auf die Sprünge helfen? Vielen DANK!! PIC18F66K80 MPLAB X IDE v3.10 PICKit 3 Compiler XC8