I am new with 16f819. I am using it to connect LCD at port B but for some reason its not working. So I first try to check all output pins using LEDs.
I am using V4
I have insert a c code osccon = 0x70;
then loop for ever
and made port A, B = 255
After burning it using TOP2007 Programmer, no led are glowing.
Can any body tell me where is the problem.
thank you.
Code: Select all
#define MX_PIC
//Defines for microcontroller
#define P16F819
#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_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 3
//Functions
#define MX_CLK_SPEED 4000000
#ifdef _BOOSTC
#include <system.h>
#endif
#ifdef HI_TECH_C
#include <pic.h>
#endif
//Configuration data
#ifdef _BOOSTC
#pragma DATA 0x2007, 0x3f18
#endif
#ifdef HI_TECH_C
__CONFIG(0x3f18);
#endif
//Internal functions
#include "C:\Program Files\Matrix Multimedia\Flowcode V4\FCD\internals.h"
//Macro function declarations
//Variable declarations
//Macro implementations
void main()
{
//Initialisation
adcon1 = 0x07;
//Interrupt initialisation code
option_reg = 0xC0;
//C Code
//C Code:
osccon = 0x60;
//Loop
//Loop: While 1
while (1)
{
//Output
//Output: 255 -> PORT A
trisa = 0x00;
porta = 255;
//Output
//Output: 255 -> PORT B
trisb = 0x00;
portb = 255;
}
mainendloop: goto mainendloop;
}
void MX_INTERRUPT_MACRO(void)
{
}