33 questions
0
votes
0
answers
25
views
Delay of RTC external an internal microcontroller ATSAMD21J18A using plib_clock.c
I'm Using an ATSAMD21J18A with internal timers and I update the library "plib_clock.c" with Harmony Code Configurator in MPLAB X IDE, but my internal timers move forward quicky, and a little ...
2
votes
1
answer
66
views
Does Frama-c support GNU-C fixed point arithmetic extension?
I am currently trying to use Frama-c with MPLAB, to check a code embedded on a microcontroller.
After struggling a bit to make Frama-c work with the compiler included inside MPLAB, I have a syntax ...
2
votes
1
answer
435
views
Adapting Compilation Chain from MPLAB X IDE to VS Code with MPLAB Plugins
My code builds fine in the MPLAB X IDE (v5.454), but for usability I want to use VS Code with the MPLAB extensions.
My requirements include the use of the xc32 compiler v2.40. The example video does ...
2
votes
0
answers
118
views
Using the enhanced ccp1 in pic18f does not output PWM
I was implementing a driver for ccp1 peripheral and after implementing it and using proteus for simulation, the enhanced PWM doesn't work while I made sure that the CCP1CON is loaded correctly and ...
1
vote
1
answer
727
views
How do I fix this module error when attempting to launch MPLAB-X IPE 6.20 version?
enter image description here
I am receiving this error when trying to launch MPLAB IPE 6.20 after downloading MPLAB IDE 6.20. Does anyone know how I can fix this?
I have uninstalled it and reinstalled ...
1
vote
0
answers
69
views
Microchip XC8 - Unexpected data memory increase after deletion of variable
I am currently optimising and streamlining development code in preparation for release.
Hardware and compiler specifics as follows:
PIC18F46J11, MPLABX, XC8 - V2.45, C99, Optimization level 1
See ...
0
votes
1
answer
855
views
Microchip MPLAB X IDE: configure and run a shared pre-build-step Bash script that runs in both Windows and Linux as part of the build process
Our team has a mix of developers on both Windows and Linux, and a shared code base that has to be able to compile on both, in the Microchip MPLAB X IDE v6.20, for PIC32 microcontrollers in our case.
I ...
0
votes
1
answer
317
views
MPLAB 8 and MPLAB X Checksums
I have a project that was built in MPLAB 8 using the Hi Tech C compiler. When I load it into MPLAB 8 to program a device I get a checksum (I use Unprotected checksum), then when I load it into MPLAB X ...
1
vote
1
answer
146
views
MPLAB X IDE v6.05, Makefile generated by what?
I'm working on historic projects developed with MPLAB X IDE v6.05, there are a lot of Makefiles and at the top of many of the files there is a comment:
#
# Generated Makefile - do not edit!
I'm ...
1
vote
0
answers
407
views
MPLAB X IDE doesn't seem to assemble my PIC16F877 assembly language program correctly
I have a very simple PIC16F877 Assembly language program as follows:
PORTD EQU 0x08
TRISD EQU 0x88
STATUS EQU 0x03
PCLATH EQU 0x0A
ORG 0
; start at address 0
BCF PCLATH, 4
BCF PCLATH, 3
...
0
votes
1
answer
473
views
Build fails for PIC32 project with CMake generated makefiles
I am trying to setup a CMake project for PIC32. This is the first time, I am setting up a CMake project. There is only a single source file with an empty main function. No additional libraries. Linker ...
0
votes
1
answer
112
views
Problem with PIC18F45K50's ANSELE register
I am trying to make code for PIC18F45K50. I am trying to use PORTE as digital input. That means I have to clear the ANSELE register which controls this pin behavior.
Working on MPLAB X 3.30, I tried ...
0
votes
1
answer
642
views
If condition does not work in Microchip MPLAB IDE XC8 compiler
/*
* File: proje_6.c
* Author: ayanoglu
*
* Created on 08 Nisan 2023 Cumartesi, 12:14
*/
#include <xc.h>
void delayFunction(unsigned int);
#define Button PORTBbits.RB0 //RB0 button
#...
0
votes
1
answer
134
views
Program compiles but doesn't do anything
I've recently started exploring and reading about Microchip's PIC32 MCUs, most specifically for motor control. I had some job done over the years but was a long while and haven't used the IDE with ...
1
vote
2
answers
414
views
MPLABX XC8 Compiler - implicit signed to unsigned conversion?
Why am I getting :
(373)implicit signed to unsigned conversion
by doing:
fan_on_hh = hh + fan_hh_increment
All fan_on_hh, hh and fan_hh_increment are unsigned char.
This post suggests to do this:
...
1
vote
2
answers
3k
views
MPLAB X IDE - Script Engine is not Supported
In using the Pickit4 for flashing the code.
When I first open the MPLAB X IDE and use the Make and Flash button to flash the MCU, it works fine.
But the next time in the same session, the Make and ...
0
votes
1
answer
415
views
MPLAB X IDE Redefinition Error after MPLAB 8 Import Project
Redefinition error due to typdef enum and pic header file. Defining AN1 to AN12 in two different header files - wont build
HI All,
I have a MPLAB 8 project which I have imported over to MPLAB X IDE. I'...
2
votes
1
answer
287
views
Initial EEPROM contents in Atmega644
I am working on a project using a Atmega644 and want to include EEPROM data in the initial programming.
I am using MPLAB X and the XC8 compiler (version 2.31) and for programming I am using a PICkit4.
...
0
votes
0
answers
54
views
I've been trying to run a code in MPLAB for interfacing a finger print scanner with PIC16F877A and LCD but the code is giving errors
Here is the code
#define _XTAL_FREQ 18432000
#include <xc.h>
#include<pic.h>
#include <stdio.h>
#include <stdlib.h>
// BEGIN CONFIG
#pragma config FOSC = HS // Oscillator ...
0
votes
1
answer
394
views
What do I need to correct in the creation of delay routine using TMR0 on the PIC16F877A, using MPLAB X IDE v6.00?
I am migrating an old program developed in mplab with mpsam, however I can't find a way to solve two lines of code that are generating errors in the new MPLAB X IDE v4.0 with pic-as.
Attached is the ...
1
vote
0
answers
42
views
Communication between SAME54 dev board and CH340
I would like to communicate string messages between a microcontroller SAME54 and another item that has a CH340 serial adapter. I would like to connect my development board SAME54 explained with ...
0
votes
1
answer
449
views
ceedling with MPLABx and XC8
I am starting unit testing using ceedling from Windows Powershell. I have made a lot of progress getting Unity to work with the XC8 compiler. But I have a problem I can't seem to solve. Here is a bit ...
1
vote
1
answer
823
views
is there a way to wait for something without interrupt the execution of other code?
i have to write a function that, by calling it only a single time, have to:
turn on an output pin
the pin stays high for 200mS
at the end of the timer the pin need to be low again.
the pin stays ...
0
votes
1
answer
218
views
Compiler does not support 64-bit integers on target Architechture
I am new to MPLAB XC8 compiler and don't know why this error is happening as I did not use any number that is of 64 bit in my code.
Code is as follow
#include <pic16f877a.h>
#pragma config FOSC =...
0
votes
1
answer
1k
views
Unable to resolve identifier
Being a beginner i have written this code in xc8 compiler but its showing warning on include file and error on port and tris register(Unable to resolve Identifier).Also When i execute this code in ...
1
vote
2
answers
380
views
Why can't I use a global bool variable whose value depends on interrupt flags? [duplicate]
I'm trying to wait for an interrupt to continue with the execution of the code, something like this:
bool flag = false;
void interrupt_handler (uintptr_t context)
{
flag = true;
}
void main()
{
...
2
votes
0
answers
94
views
can data from a sensor be read in a function
I am using the icm 20948 sensor, programming on MPLABx running harmonyV3.i2c is communication mode. Can I read and write in a function, does it have to be in a while loop?
For example would:
while(...
1
vote
0
answers
101
views
How to apply driverless device into harmony v3
I would like to apply HM628128 and MX25L800 to File System of MPLAB® Harmony v3.
But, the file system (MEMORY driver) of harmony v3 with default condition can be only applicatable to RAM/ROM listed ...
0
votes
1
answer
502
views
how to combine ADRESH and ADRESL on 12 bit ADC
MICRO: PIC18LF47K42
compiler: XC8
application: MPLABX
I am trying to combine the values in of 12 bit ADC. They go into ADRESH and ADRESL. My ADC is set up for right-justify which does formating as so:
...
0
votes
0
answers
126
views
What is wrong with this PIC16F877A HCSR04 example?
I am working on distance sensor with PIC16F877A.
I am using MPLAB IDE AND XC8 compiler.
My goal is to gradually turn on the right leds at certain distance levels, but the leds are blinking unstable. ...
0
votes
1
answer
707
views
How to develop for PIC32MM without either MPLABX or XC32
While working for just one month with the MPLABX5.5 + XC32 3.01 I've already had 3 separate instances where code compiled incorrectly, causing my program to fail after either the stack or frame ...
-2
votes
1
answer
212
views
Any clue as to why my code has errors in it? [closed]
I used MPLAB X IDE (a software for microcontrollers) to compile my code, but for some reason it keeps saying that there are at least two errors (specifically in the area that is bolded). I tried ...
1
vote
0
answers
121
views
XC16 - How do I prevent a parameter const array body to be copied to RAM?
I know const variables are copied to RAM so they can be referenced, but if I declare a const array body as a parameter in a function call, is it copied to RAM every time I do the call?
printf("...