//************************************************************************************
//**  
//**  File name:     D:\sachs_work\ECIO\v4_sa_ecio_anz\pe0 ok- pe1 nok - pe2 ok.c
//**  Generated by:  Flowcode v4.3.7.63
//**  Date:          Tuesday, June 29, 2010 10:59:46
//**  Licence:       Professional
//**  Registered to: WOLFGANG SACHS
//**  
//**  
//**  http://www.matrixmultimedia.com
//************************************************************************************


#define MX_PIC

//Definitionen für Microcontroller
#define P18F4685
#define MX_EE
#define MX_EE_TYPE3
#define MX_EE_SIZE 1024
#define MX_SPI
#define MX_SPI_C
#define MX_SPI_SDI 4
#define MX_SPI_SDO 5
#define MX_SPI_SCK 3
#define MX_UART
#define MX_UART_C
#define MX_UART_TX 6
#define MX_UART_RX 7
#define MX_I2C
#define MX_MI2C
#define MX_I2C_C
#define MX_I2C_SDA 4
#define MX_I2C_SCL 3
#define MX_PWM
#define MX_PWM_CNT 2
#define MX_PWM_TRIS1 trisc
#define MX_PWM_1 2
#define MX_PWM_TRIS2 trisd
#define MX_PWM_2 4
#define MX_ECAN

//Funktionen
#define MX_CLK_SPEED 40000000
#ifdef _BOOSTC
#include <system.h>
#endif
#ifdef HI_TECH_C
#include <pic18.h>
#endif

//Konfigurations-Daten
#ifdef _BOOSTC
#pragma DATA 0x300000, 0xff
#endif
#ifdef _HI_TECH_C
//__CONFIG(, );
#endif
#ifdef _BOOSTC
#pragma DATA 0x300001, 0x6
#endif
#ifdef _HI_TECH_C
__CONFIG(1, 0x6ff);
#endif
#ifdef _BOOSTC
#pragma DATA 0x300002, 0x1e
#endif
#ifdef _HI_TECH_C
//__CONFIG(, );
#endif
#ifdef _BOOSTC
#pragma DATA 0x300003, 0x1e
#endif
#ifdef _HI_TECH_C
__CONFIG(2, 0x1e1e);
#endif
#ifdef _BOOSTC
#pragma DATA 0x300004, 0xff
#endif
#ifdef _HI_TECH_C
//__CONFIG(, );
#endif
#ifdef _BOOSTC
#pragma DATA 0x300005, 0x80
#endif
#ifdef _HI_TECH_C
__CONFIG(3, 0x80ff);
#endif
#ifdef _BOOSTC
#pragma DATA 0x300006, 0x80
#endif
#ifdef _HI_TECH_C
//__CONFIG(, );
#endif
#ifdef _BOOSTC
#pragma DATA 0x300007, 0xff
#endif
#ifdef _HI_TECH_C
__CONFIG(4, 0xff80);
#endif
#ifdef _BOOSTC
#pragma DATA 0x300008, 0x3f
#endif
#ifdef _HI_TECH_C
//__CONFIG(, );
#endif
#ifdef _BOOSTC
#pragma DATA 0x300009, 0xc0
#endif
#ifdef _HI_TECH_C
__CONFIG(5, 0xc03f);
#endif
#ifdef _BOOSTC
#pragma DATA 0x30000a, 0x3f
#endif
#ifdef _HI_TECH_C
//__CONFIG(, );
#endif
#ifdef _BOOSTC
#pragma DATA 0x30000b, 0xe0
#endif
#ifdef _HI_TECH_C
__CONFIG(6, 0xe03f);
#endif
#ifdef _BOOSTC
#pragma DATA 0x30000c, 0x3f
#endif
#ifdef _HI_TECH_C
//__CONFIG(, );
#endif
#ifdef _BOOSTC
#pragma DATA 0x30000d, 0x40
#endif
#ifdef _HI_TECH_C
__CONFIG(7, 0x403f);
#endif

//Interne Funktionen
#include "C:\Program Files\Matrix Multimedia\Flowcode V4\FCD\internals.h"

//Makro-Funktions-Deklarationen


//Variablen-Deklarationen



//Makro-Implementierungen

void main()
{
	
	//Initialisierung
	adcon1 = 0x0F;
cmcon = 0x07;


	//Interrupt-Initialisierungs-Kode
	


	//Output
	//Output: 0 -> E1
	trise = trise & 0xfd;
	if (0)
		porte = (porte & 0xfd) | 0x02;
	else
		porte = porte & 0xfd;


	//Verbindungspunkt
	//Verbindungspunkt: [A]: A
FCC_Haupt_A:
;


	//Kommentar:
	//porte off


	//Output
	//Output: 0 -> E0
	trise = trise & 0xfe;
	if (0)
		porte = (porte & 0xfe) | 0x01;
	else
		porte = porte & 0xfe;


	//Output
	//Output: 0 -> E2
	trise = trise & 0xfb;
	if (0)
		porte = (porte & 0xfb) | 0x04;
	else
		porte = porte & 0xfb;


	//Warten
	//Warten: 10 ms
	delay_ms(10);


	//Kommentar:
	//porte on


	//Output
	//Output: 1 -> E0
	trise = trise & 0xfe;
	if (1)
		porte = (porte & 0xfe) | 0x01;
	else
		porte = porte & 0xfe;


	//Output
	//Output: 1 -> E2
	trise = trise & 0xfb;
	if (1)
		porte = (porte & 0xfb) | 0x04;
	else
		porte = porte & 0xfb;


	//Warten
	//Warten: 10 ms
	delay_ms(10);


	//Gehe zum Verbindungspunkt
	//Gehe zum Verbindungspunkt: [A]: A
	goto FCC_Haupt_A;


	mainendloop: goto mainendloop;
}

void MX_INTERRUPT_MACRO(void)
{
}



