637 questions
2
votes
1
answer
65
views
PIC-AS locations and debugging for 10F202 with OSCCAL at reset vector?
I am quite new to the PICs and especially with XC8 pic-as and MPLAB-X
I have a ultra minimal project i am working on, and i have some questions regarding the OSCCAL values located at the reset vector, ...
0
votes
0
answers
77
views
issues with "atof" function in MPLAB X IDE v6.25 with XC8 v03.00
I'm working on some code for a PIC microcontroller PIC18F47J53. I'm using MPLAB X IDE v6.25 and the package PIC18F-J_DFP 1.9.170. Both are latest versions.
A year ago, I used exactly the same code, ...
1
vote
1
answer
95
views
Why does my code give multiple definitions error?
I am trying to build the following code on my computer but I run into a lot of errors. The error says that g_tagParams and g_loggerparams are multiply defined in many of the functions. But these two ...
1
vote
0
answers
99
views
UART Proteus Simulation PIC24FJ128GA010
I want to make a simple UART transmission / reception from the PIC to hyperterminal in proteus. I will start by showing my code, then state the problem:
#include <stdbool.h>
#include <...
0
votes
0
answers
97
views
PIC Assembler, rlf behaving weird
I have a question, when I use this code in MPLAB IDE v8.92, Windows 11, when it arrives to the rlf line it behaves weird either if I use 0 or 1 for "d" in rlf. Values for j and k are 0xFF.
...
2
votes
1
answer
238
views
No language server found at path "". Language support for MPLAB projects will be unavailable
I am using the MPlab extension for VScode it has been working for very basic lines, but it always gives me this warning during startup. How do I fix this?
I have tried building more advanced projects ...
1
vote
1
answer
89
views
Why is the stopwatch for PIC32MZ2048EFM144 microcontroller always disabled?
I am using a PIC32MZ2048EFM144 uC. I wanted to know time taken for a routine called adc7768(). When I go to
window->debugging->stopwatch
and try to debug it gets hung. Debug will not happen. ...
2
votes
1
answer
436
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 ...
0
votes
0
answers
42
views
MPLabX MCC - Text glitchy and unreadable
I've recently installed MPLabX IDE and I'm trying to use it. I'm quite familiar with both the IDE and the MCC, as I've been using them for over a year now (on my company's PCs though).
But at home, ...
2
votes
2
answers
106
views
Union of struct with one element vs union of element mplab pic32
I was looking at a pic 10 include file (p32mk1024gpk064.h) and was wondering why they added a struct with a single element instead of an union between a struct and an uint_32.
typedef union {
struct ...
0
votes
1
answer
89
views
PIC18F const variable at odd flash address
Is there any way to place a const variable to an odd address of the flash, so that the value is in the HEX file?
It needs to be at a specific flash address, i can not use the SAF Block because its to ...
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 ...
0
votes
1
answer
117
views
Upgrading from MPLAB ICD-2 to ICD-3 to move from PIC 18F87J10 to PIC 18F87K22
For my hobby I used to get boards for a particular device, and used to reprogram the microchip PIC 18F87J10 using MPLAB ICD-2 (I run it from my VM VirtualBox running Windows XP). Now the company from ...
2
votes
1
answer
111
views
Pic18f47k40 EUSART setup
I am trying to implement Modbus RTU in a device that has a PIC18f47k40 MCU with baudrate of 19200.
I started by setting up eusart1 for sending and receiving.
This is the code in main.c that is ...
1
vote
0
answers
350
views
How to read Flash ID (RDID) through SPI?
I try to read Flash ID (MX25L51245G) through SPI and my MCU is PIC32MX360F512L. According to the datasheet, the command should be 9F and receive C2 20 1A. But I always receive wrong ID data.
I tried ...
-1
votes
1
answer
157
views
How to use UART in PIC16F877A with assembly code?
I am using UART in PIC16F877A with test board HJ-5G.
My oscillator is 4MHz (KDS4.000). I tried to receive data from my computer.(Serial Debug Assistant)
But I do not receive anything. And I tried to ...
0
votes
0
answers
57
views
FreeRTOS MPLAB implementation (WITHOUT MPLAB HARMONY)
Good morning/afternoon
I'm currently programing a PIC32MX795F512L in MPLAB, the problem I'm getting is while trying to implement the FreeRTOS library.
I have downloaded it from its official page, ...
0
votes
2
answers
122
views
Issue with the delay and the toggle on PIC16F84A micro
Task 1: Create a 1 Hz Square Waveform on PORT.A0
Write an assembly language program to create a 1 Hz square waveform on PORT A0.
a) First write your code to toggle PORT A0 without any delay
b) Then ...
0
votes
1
answer
858
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
320
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
110
views
C sscanf not capturing the second argument
Using MPLAB to code for PIC16 in C using the XC8 compiler.
I am trying to capture some baud rate settings from a string, for example "115200,8,N,1".
For the purpose of my application, I have ...
0
votes
1
answer
203
views
MPLAB XC8 compiler - too many instructions in disassembly view PIC10F200
I am trying to compile this code in order to generate a PWM signal 15us HIGH and 9us LOW.
#include <xc.h>
void g()
{
for(char val=0; val<20; val++)
{
GPIO = 0xFF;
NOP()...
-1
votes
1
answer
70
views
Can't declare output in MPLAB X even though I included the header file [closed]
I am trying to program a PIC32MX470F512H to execute a simple LED blinking program; however, I am recieving errors when declaring the LED output. I am not exactly sure the reason behind the error, and ...
0
votes
0
answers
195
views
Using sprintf to change a double to a string in MPLAB IDE v6.20
I have been using the console to print (through UART) it has always worked fine but for some reason every time I use sprintf it seems to lock up the system and not allow me to print the string value ...
0
votes
1
answer
214
views
Arduino IDE Error: MPLAB XC32 C++ license not activated
What I want to do :
I want to learn how to program with the Basys MXC32 device.
What I have done
I use Arduino IDE (version 1.8.19) and I am on Ubuntu 22.02 . I followed what is written in this ...
0
votes
2
answers
335
views
PIC10F200 coding/setup issue
What I use
Arduino Uno (as a power supplier)
PicKit 5
MPLAB X IDE 6.15
PIC10F200
What I know :
The OPTIONS on some pins can overwrite the TRIS states (I somewhat read the datasheet but it gets me ...
0
votes
1
answer
144
views
PIC18F2550 assembly code for turning led on with a switch isn't working
This is the code made in MPLAB X with compiler XC8 :
PROCESSOR 18F2550
#include <xc.h>
; CONFIG1L
CONFIG PLLDIV = 1 ; PLL Prescaler Selection bits (No prescale (4 MHz ...
0
votes
1
answer
141
views
DHT11 code from pic18f4550 does not work with pic18f57Q84
I am trying to read the DHT11 on a PIC18f57Q84 and display it to an LCD screen. I found somebody online who did this for a PIC18f4550 and tried to make it work on my PIC18f57Q84 development board. I ...
2
votes
0
answers
117
views
C "pass by pointer" value not updated when expected [closed]
I have a function where the data value is updated by a library call and returned via pointer. Note that in the body of the function, I print the de-referenced value of data following the call to ...
0
votes
1
answer
523
views
Can connect and write hex files from MPLAB X IPE but can not debug from MPLAB X IDE
Currently using MPLAB X IDE and IPE v6.15 with PIC16F1503 and PICKIT 4 for debugging. I have connected the PICKIT 4 on the ICSP interface with PIC16F1503. I can connect the PICKIT4 and write HEX files ...
0
votes
1
answer
71
views
Is there an solution to stop looping this
Settings of the MCU:
This is the circuit in Proteus:
I wrote this code for the led to blink for one time only but it's blinking for infinite times.
Could anyone tell how to stop automatically ...
0
votes
2
answers
456
views
MPLAB X IDE code for PIC18F452 microcontroller (indirect addressing)
Using Indirect addressing I'm trying to copy the value 77H into RAM memory locations 50H to 55H. The issue I'm running into is a build error where it says FSR and INDF are not previously defined ...
0
votes
2
answers
2k
views
Programming HEX using MPLAB X IPE v6.15, leads to PIC not starting
When programming my PIC18F6722 using MPLAB IDE v8.91 (the 32bit version), my PIC works and starts successfully, but when I use the HEX generated from MPLAB IDE, but program it using MPLAB X IPE, the ...
1
vote
1
answer
2k
views
MPLAB X IDE 6.15 Assembly Toolchain
Years ago I worked with MPLAB and have decided to start learning it again for an upcoming project. For the PIC microcontroller's I prefer to work in assembly, however I am have issues setting it up.
...
0
votes
1
answer
415
views
MPLAB X project directory file colors - what do they mean
I'm resurrecting a project from a decade ago. The previous programmer was old school and did everything via the command line. By all accounts his code is very well written. I'd like to move this to ...
0
votes
2
answers
180
views
WDT, TIMER0 16F676 delay calculation problem. Prescaler issue in MPASM
Regarding the calculations of delays: I understand delay when somebody explaining it in their code. But when it comes to my code, I’m totally a mess (calculating a delay for two days). This is the ...
1
vote
1
answer
415
views
How to calculate Delay in PIC MCU, in pic-as
I wrote a program for 1 second delay led blink program using mplab ide and pic-as assembler. But the led is not turn on. I cant spot the problem. I changed multiple delay values. The led mightily ...
1
vote
2
answers
1k
views
How can I fix this syntax error in MPLAB X IDE?
I am a beginner to PIC microcontrollers, and I want to make the LED light up.
However, every time I want to build the code, it returns a syntax error. I am unsure of what the syntax error actually is ...
2
votes
4
answers
7k
views
MPLAB X IDE v6.10, when i try to load my projects and open it. it gives an message "Loading" and the project doesnt open & the debugger is disabled
In MPLAB X IDE V6.10, Initally it is working fine. But after sometime when i tired to open project it is showing loading but project is not opening. And Uploading and Debugger option is disbale can't ...
0
votes
1
answer
267
views
PIC32CX register names not in header?
I'm trying to hack away using a PIC32CX BZ2. Since there's no code completion for some weird reason in MPLAB, I'm kinda forced to know the register names, or whatever is set declared in the header ...
1
vote
1
answer
454
views
MPLAB X pic building the dissembled output and flashing to the same target (round-trip)
What I have done
I've started my first Reverse-Engineering project and have extracted the HEX from the PIC16F1938 processor of the Delonghi Dedica EC685 coffee machine. The stock firmware can be found ...
0
votes
1
answer
620
views
how to clear RCREG in pic uart
is it possible to clear RCREG on uart in PIC?
hi
I am studying Uart data transmitter and receiver.
is it possible to clear or erase RCREG value?
first of all, I use pic16f690, mplab ide v8.84(not x ...
0
votes
1
answer
119
views
is there a code for delaying a microcontroller
I am programming a PIC16F84A microcontroller to monitor three doors, if one of the doors is open it should trigger an alarm and write D1, D2 0R D3 on a seven segment display. OR it should write ALL if ...
1
vote
2
answers
111
views
Weird notes being played on piezo buzzer when deviding with not a constant integer
So this is a more complicated problem. I am currently programming a little developer test board with a PIC16F1509 with the MPLAB X IDE and flashing the compiled hex file via a custom USB UART Bridge ...
2
votes
4
answers
862
views
Bit-packing Problem in a Union (Register Mapping)
I am trying to get a union together to map out some bit fields in a register map. The code I have is the following:
typedef union __attribute__((packed)) {
struct {
uint8_t MODE:3;
...
1
vote
1
answer
167
views
.eep file generation in MPLAB X
I use MPLAB X. I want enable .eep file generating. How I can do it?
1
vote
2
answers
590
views
How to use PIC12F675 timer1 interrupt?
What is wrong with this code? The interrupt at 0004 never executes!
MPLAB X IDE simulator
I tried changing all the bits of T1CON, but no results
; TODO INSERT CONFIG CODE HERE USING CONFIG BITS ...
0
votes
1
answer
106
views
Unable to resolve identifier RBIE and RBIF, any guess?
trying to compile a code but keep giving build failed and checking red flags shows only Unable to resolve identifier in RBIE and RBIF.
below is the code i have im using it with a pic18f45k50 with a ...
0
votes
1
answer
202
views
MPLAB Harmony Timer triggers once and stops the chip
I have MPLAB X v 6.05 and am using harmony 3 on a pic32mx795 device. I made a simple program to toggle the output of a pin connected to an led. It works, but only once. After Tmr1 triggers (2.5sec), ...
0
votes
1
answer
4k
views
Can't get MCC Code Configurator to work in MPLAB X
I have freshly installed mplab X v6.05, a code compiler xc32, the harmony config files from Github, and the latest version of Java. I create a new 32bit MCC project and load the MCC tab. I choose ...