1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
| #define MX_PIC
//Définir pour microcontrôleur
#define P16F88
#define MX_EE
#define MX_EE_TYPE2
#define MX_EE_SIZE 256
#define MX_SPI
#define MX_SPI_B
#define MX_SPI_SDI 1
#define MX_SPI_SDO 2
#define MX_SPI_SCK 4
#define MX_UART
#define MX_UART_B
#define MX_UART_TX 5
#define MX_UART_RX 2
#define MX_I2C
#define MX_I2C_B
#define MX_I2C_SDA 1
#define MX_I2C_SCL 4
#define MX_PWM
#define MX_PWM_CNT 1
#define MX_PWM_TRIS1 trisb
#define MX_PWM_1 0
#define MX_PWM_TRIS1a trisb
#define MX_PWM_1a 3
//Fonctions
#define MX_CLK_SPEED 19660800
#ifdef _BOOSTC
#include <system.h>
#endif
#ifdef HI_TECH_C
#include <pic.h>
#endif
//Données de Configuration
//Fonctions internes
#include "C:\Program Files\Matrix Multimedia\Flowcode V4\FCD\internals.h"
//Déclarations de fonction Macro
//Déclarations de Variable
//Implémentations Macro
void main()
{
//Initialisation
ansel = 0;
cmcon = 0x07;
//Code d'initialisation d'Interruption
option_reg = 0xC0;
//Code C
//Code C:
/*Entrer le code C après ces commentaires
Par ailleurs, pour entrer du code assembleur,
utiliser l'opérateur asm devant chaque instruction, par exemple
asm movlw 5
ou imbriquer plusieurs instructions dans un bloc asm comme ci-dessous :
asm
{
movlw 8
movlw4
}
*/
trisa = trisa & 0xfb;
if (1)
porta = (porta & 0xfb) | 0x04;
else
porta = porta & 0xfb;
mainendloop: goto mainendloop;
}
void MX_INTERRUPT_MACRO(void)
{
} |
Partager