While I'm waiting for my Curiosity HPC, I'm trying to get this thing to blink. No success. I had a somewhat good run with MSP430, but PIC is not giving me any slack. I suspect that I am not using the software right, as I can not say anything wrong with the code.
I'm not using an external crystal, but I've it to run on the internal one. The setup is just the Pickit3 hooked up to the respective pins on the PIC16F1615. The attached image shows another MCU, since the one in use was not in the KiCad library.
When I flash the code, I just hit "Build Main Project" (F11), the hammer icon. It compiles, but says "ProjectLocation.production.hex does not exist", yet still I get build successful. I think I've seen in videos, when one compiles, the XC8 compiler runs in the background, but I can't find and executable file for the compiler to open, and I've not had any luck finding a compiler user guide. One funny thing is that if I pull the pins out of the Pickit3, it still says build successful.
Any thoughts?
NOTE: The led and the resistor are in opposite order on my board. Everything is checked and double checked.
I'm not using an external crystal, but I've it to run on the internal one. The setup is just the Pickit3 hooked up to the respective pins on the PIC16F1615. The attached image shows another MCU, since the one in use was not in the KiCad library.
When I flash the code, I just hit "Build Main Project" (F11), the hammer icon. It compiles, but says "ProjectLocation.production.hex does not exist", yet still I get build successful. I think I've seen in videos, when one compiles, the XC8 compiler runs in the background, but I can't find and executable file for the compiler to open, and I've not had any luck finding a compiler user guide. One funny thing is that if I pull the pins out of the Pickit3, it still says build successful.
Any thoughts?
NOTE: The led and the resistor are in opposite order on my board. Everything is checked and double checked.
Code:
/*
* File: main.c
* Author:
*
* Created on November 7, 2019, 8:50 PM
*/
#include <stdio.h>
#include <stdlib.h>
#include <xc.h>
#include "newxc8_header.h"
#define _XTAL_FREQ 8000000
//BEGIN CONFIG
#pragma config FOSC = INTOSC // Oscillator Selection bits (HS oscillator)
#pragma config WDTE = ON // Watchdog Timer Enable bit (WDT enabled)
#pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled)
#pragma config BOREN = ON // Brown-out Reset Enable bit (BOR enabled)
#pragma config LVP = OFF // Low-Voltage (Single-Supply) In-Circuit Serial Programming Enable bit (RB3 is digital I/O, HV on MCLR must be used for programming)
//#pragma config CPD = OFF // Data EEPROM Memory Code Protection bit (Data EEPROM code protection off)
#pragma config WRT = OFF // Flash Program Memory Write Enable bits (Write protection off; all program memory may be written to by EECON control)
#pragma config CP = OFF // Flash Program Memory Code Protection bit (Code protection off)
//END CONFIG
int main()
{
TRISA4 = 0; //RB0 as Output PIN
while(1)
{
RA4 = 1; // LED ON
__delay_ms(1000); // 1 Second Delay
RA4 = 0; // LED OFF
__delay_ms(1000); // 1 Second Delay
}
return 0;
}
Attachments
-
79.2 KB Views: 9