Questions tagged [mplab]

IDE for the Microchip PIC series of microcontrollers.

1
vote
3answers
71 views

How can I add a delay of 90 minutes when a port has gone from 0 to 1?

I have a PIC12F1822 of which there is an LED and relay as an output and a trigger as an input. When the trigger is equal to one, I would like the to have the LED and relay stay turned on for 90 ...
0
votes
2answers
28 views

MPLABX XC16 unable to resolve built-in identifier __builtin_dmaoffset

Im trying to do some basic ECAN sending using a dsPIC33FJ128GP802 and its built in DMA. The problem that im facing is that all the code examples in the documentation use the built in function ...
0
votes
0answers
22 views

Printf / show values on MPLAB X IDE - dsPIC33F

I'm a real PIC beginner and I'm trying to use a development board with a dsPIC33F, using the MPLAB X IDE and CANalyzer. I send CAN frames with the dsPIC but the data read by CANalyzer is not the one I ...
2
votes
1answer
45 views

Declaring 16bit memory variable in assembly

I'm starting to study assembly for PIC18f4550 and I've been trying to do some activities and I don't know how to solve it. According to the activity, Using MPLABX, I'm supposed to sum 2 16bit ...
1
vote
2answers
54 views

Why is my Timer2 interrupt not working? Am I missing any register configs?

I am working on a project with the pic10f322 microcontroller. I've made a very basic communication protocol - there is a start pulse (10 ms) followed by a number of 5ms pulses (2 pulses - turns on a ...
0
votes
2answers
39 views

PIC18 IO-Port noobie issues with XC8

I'm comming from many years on AVR and starting my first PIC project with a PIC18F46K42. Using actual MPLAB v5.15 with XC8 compiler v2.05 (set to C99 standard). (signing up at the microchip forum ...
1
vote
2answers
71 views

Constant argument problem with PIC XC8 and __delay_ms() function

There is a built in function in xc8 called __delay_ms() that allows you to achieve an accurate delay. My problem is that you can only put in a constant value like __delay_ms(1000) for 1 second. MPLAB ...
0
votes
1answer
43 views

How to make PIC18F4520 launch RTC interrupt from datasheet

I want to build a binary clock using the timer1 module as RTC with the code example from the datasheet, but although I wrote the necessary code around it, the interrupt does not trigger. Did I miss a ...
0
votes
0answers
70 views

Output ADC as binary waveform on oscilloscope

I´m building a project where i want to transfer an analog signal from a mikrocontroller (PIC16F1827) to an Arduino via IR-diodes. The PIC takes a analog signal (0-5 V) from a potentiometer (10k Ohm) ...
0
votes
1answer
47 views

How to Connect MPLAB ICD2 with Adapter for Pic 18F14K50

I want to know the connecting steps for MPLAB ICD 2 with PIC18F14K50 microcontroller Programming adapter and header
0
votes
1answer
40 views

Mplabx 5.15 on Ubuntu 18.04 can not use ICD 3

I keep getting this error with ICD 3 when attempting self test: Could not connect to the selected hardware tool. Please make sure the tool is not being used by another project in MPLAB X. The device ...
0
votes
1answer
34 views

Multiple definition of Variable while it is not

I am trying to compile an empty project using MPLAB X IDE. I have just used mcc (microchip code configurator) to make the first configuration of the clock only. mcc generated a bunch of header files ...
0
votes
0answers
21 views

How to add library “cx.h” for programming microcontrollers in CLion IDEA?

I use MPLAB® X development environment in which the project is compiled using MPLAB® XC8 Compiler v2.05.compiler in MPLAB link for MPLAB® XC8 Compiler v2.05 . When writing code, the library is ...
0
votes
1answer
41 views

Mikrocontroller (PIC16F1827) ADC scrambled output with MCC in MPLAB

Im trying to construct an AD-converter from a potentiometer to an Arduino. I´m trying to learn MCC in MPLAB at the same time. So far I have generated a code that fits my PIC (I think...). My problem ...
0
votes
2answers
108 views

UART does not transmit/print more than one character

I am trying to setup basic serial communication between dsPIC33FJ64GP802 and a terminal and PC using UART module. However, UART does not transmit more than once character. I am using MPLAB-X (V 5.05). ...
-1
votes
1answer
21 views

mplabx ide v5.10 version configuration failed… How can I regulate?

I take these errors when making clean and build or debug **`list P=18F45K22, r=dec, n=0 #include ; /* setup to use the 4xPLL with a 16MHz internal oscillator for a 64MHz system clock */ ...
1
vote
0answers
55 views

Unable to execute interrupt function

Using Mplab ide 5.10 and xc8 compiler for the pic18f4550 I am unable to get the code to get into the interrupt function the goal is to get J to count up in the background until something trigger it to ...
0
votes
0answers
54 views

PowerLine Communication using a Cypress CY8CPLC10 and a PIC32 µController

I'm trying to run a CY8CPLC10 IC in order to communicate via PLC but it doesn't seem to work at all: I communicate with the IC via I2C communication, I do the right init sequence and I follow all the ...
0
votes
1answer
113 views

Symbol “file@variable” defined more than once

IDE: MPLAB X v2.15 CC: XC8 v1.32 Target device: PIC18f45k20 I have a header file reg.h, which contains a variable static const int aaasdf = 3; That header has proper include guards at the ...
0
votes
1answer
23 views

How to detect the start of an ICSP session?

My board can be started with a blank pic and programmed through ICSP without problems but while running, the start of a programming session may lead to dangerous behavior. How can I detect the start ...
0
votes
1answer
30 views

MPLAB: XC8: Cannot assign struct variable

I am trying to compile the following code in MPLab v5.10 using XC8 for a PIC18. The code is as follows: struct vec2i { int x; int y; }; void main(void) { static struct vec2i array[10]; ...
0
votes
1answer
34 views

MPLab simulator PIC16 assembler infinite loop - program doesn't END

This is a little program in assembler executed in MPLAB with SIMULATOR for PIC16. I don't understand why after the last NOP of the last three NOP the program return to the first of that group of NOP. ...
-1
votes
3answers
45 views

PicKit3 and PIC16F1829 programming, MCLR voltage

I just started with microchip world. I'm about to buy a PicKit3 and i've seen it can outputs from 1.8V to 14V MCLR. The pic i will use is the PIC16F1829 and it should work with MCLR @ 5V. In the ...
0
votes
1answer
107 views

Unable to run Interrupt function in code not working

Having problems with this part of the code: void interrupt ISR_Timer0_Int mplabs x ide 5.10 show error: newmain.c:26:6: error: variable has incomplete type 'void' newmain.c:26:15: error: ...
1
vote
1answer
23 views

Programmer for IC 24AA64I/SN other than MPLAB?

Is there any suitable software and programmer device that suitable for IC 24AA64I/SN other than MPLAB?
0
votes
1answer
116 views

How to wake Pic32 from sleep mode?

I am trying to keep PIC32 in sleep mode on boot up. And when the power button is pressed the Pic32 should exit the sleep mode and wake up. I am able to put PIC32 in sleep mode but I am not sure how I ...
-3
votes
1answer
199 views

How to convert hexadecimal to decimal in assembly language

I need to convert from hexadecimal to decimal in assembly language MPLAB, the problem is that I don't know how to represent the decimal digit in the file registers, it works fine from 0 to 9 but 0A is ...
2
votes
0answers
56 views

ACKEN bit on PIC24FJ64GA002 not clearing after acknowledge sequence

uint8_t i2c_read(void) { uint8_t u8_readData; uint8_t u8_ackBit = 0; while(I2C1CON & 0x1F); //wait for idle I2C1CONbits.RCEN = 1; //prepare device to receive ...
0
votes
1answer
423 views

MPLAB X IDE: Writing Boot Loader application for PIC32

I'm new with Microchip programming and I'm getting some troubles. I need to write a bootloader application using MPLAB X IDE but I don't know how to set up the compiler/linker in order to create an ...
-1
votes
1answer
56 views

Program not displaying correct output - MPLAB X IDE

I developed this program which is supposed to display all odd numbers between 1-99 on the top line of the LCD with a 0.5 second delay between each iteration. However, when I run the below code, my ...
1
vote
5answers
156 views

Read 'N' bit from a byte

I need to read a specific bit from a byte. The value i want to test is 0 or 1. unsigned char Buffer[0]=2; //or binary 0b00000010 How can i read n bit from buffer. If it's 0 or 1? Example if 7 bit ...
-1
votes
1answer
212 views

How to upload a hex file to dsPIC33 from linux command line?

I want to write a script to upload the hex file from host computer to dsPIC33 and hence need a command line utility or API to do the same. Till now I have been programming the chip with the MPLAB IPE ...
1
vote
2answers
82 views

Warning 359 when passing string to char*

I'm trying to pass a string to a function: void PassString(unsigned char * value) { // ... } int main(void) { while(1) { PassString("TEST"); } } I'm getting warning: (359) ...
0
votes
2answers
33 views

Pass array in method and get it's size [duplicate]

I need to pass an array inside a routine and then to read its size. typedef struct { unsigned char Name[20]; }Sensors_; extern volatile Sensors_ Sensor; then inside source file I'm using this ...
0
votes
0answers
41 views

SIM 800 read first unread message

I'm trying to find an AT command, which will allow me to read first unread sms from SIM 800. Till the method I follow(which is not propably the best idea...) I read inside a loop SMS from index 0 ...
0
votes
0answers
55 views

Configuration of the input capture functionality of PIC18F46K22

I'am using a PIC18F46K22 to measure time that elapses between two event (rising edges of a square wave) using the input capture mode. I configured the related registers but I don't know because the ...
0
votes
2answers
74 views

integer to string method [duplicate]

I'm trying to create an integer (maximum four digits to string). Here is my method: char *ToInt( int Value) { char buffer[4]; sprintf(buffer, "%04d", Value); return buffer; } After that ...
1
vote
2answers
123 views

How to pass a 10 bit value to two registers?

I'm trying to pass the value of DC to both CCPR1L, DC1B1, and DC1B0, right now I am doing it manually, but is there a way of using the value of DC directly? void SetDCPWM1(unsigned int DC){ ...
0
votes
0answers
47 views

MPLAB not accepting some character from keyboard

I am using MPLAB X IDE 4.15. Everything is working but I can't type the letter t e r. Although I can copy and paste these letters. It seems weird and I have no Idea why my IDE is behaving like this. ...
0
votes
2answers
151 views

use of undeclared identifier 'RD16'

I am trying to set the TMR1 T1CON register for a PIC18F4550 but I am getting an error related to the RD16 bit.I am getting : config.c:17:1: error: use of undeclared identifier 'RD16' RD16 = 1; ^ 1 ...
0
votes
0answers
73 views

Problem in setting code offset in XC16 (PIC24)

Is there a way to set code offset in MPLABX XC16 compiler? There's a linker option in XC8 but I cannot find that option in XC16.
0
votes
2answers
63 views

Creating a custom uppercase method

I'm trying to create an upper case method(i can't use it from library cause my software doesn't support it). The problem is that when i use my method in my output have always the last result from my ...
2
votes
0answers
34 views

Register address stored in another register (PIC18F45K50)

I have the following scenario using a PIC18F45K50: I have the value of 0x71 stored in the register 0x50. And I have a value of 0x05 stored in the register 0x71. How can I access the value stored ...
1
vote
2answers
77 views

For Loop not working properly in MPLAB IDE for PIC Micrcontroller Program

I am running the below-given program but the problem is that for loop runs only once and turns on the LED and then Turns OFF. It should run for 5 times. Below is the code: void led(void) { RB0=~...
1
vote
1answer
96 views

What is the xc16 command to obtain disassembly (listing.disasm) file?

I want to obtain disassembly (listing.disasm) file for my project. My current compilation commands produces .elf, .map and .hex files. How do I (Or what commands) produce a single listing.disasm? Note:...
1
vote
1answer
59 views

Unable to copy array in PIC24FJ256GB206 with C30 compiler

I am trying to copy an array into another in PIC24 PIC24FJ256GB206 microcontroller with C30 compiler. Length of my array is more than 1500 bytes. Here is my code:- int i=0; int count = sizeof(rx.data....
0
votes
0answers
40 views

MPLAB X IDE v4.20 and Simulink R2018a

At first sorry for my bad language but I'm not a native speaker. What I try to do is pretty simple: Create Simulink Model Use Embedded Coder to generate .c and .h files (You maybe recommend another ...
1
vote
1answer
302 views

error in project loading in MPLAB X IDE v4.15

I am trying to load project on MPLAB X IDE V4.15 written for PIC32MX270F256B on XC32 compiler V1.4 . When I load this project I got this error :- Error: Project "Bus_ClassD" refers to file "...
1
vote
1answer
33 views

No C32 compiler option for PIC32MX270F256B

I am trying to compile a code written for PIC32MX270F256B. For this I want to use C32 compiler in MPLAB X IDE V4.15. I am using C32 compiler successfully in all other projects but weirdly enough there ...
0
votes
0answers
28 views

Syntax Error inside typedef const struct [duplicate]

I'm trying to create a const struct usign using the name of each parameters. typedef const struct { uint8_t RegisterNumber; }StaticParameters; StaticParameters MenuRegisters[2] = { ....

http://mssss.yulina-kosm.ru