Questions tagged [mplab]

IDE for the Microchip PIC series of microcontrollers.

0
votes
1answer
14 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
0answers
15 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
20 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
15 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
21 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
72 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
16 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
26 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
50 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
85 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
22 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
13 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
32 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
2answers
37 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
62 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
56 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
101 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 ...
1
vote
0answers
49 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
238 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
53 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
116 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
144 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
37 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
45 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
68 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
119 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
46 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
104 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
61 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
62 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
33 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
52 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
73 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
58 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
36 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
282 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
31 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] = { ....
0
votes
1answer
42 views

Same ArrayName in struct with different ID

I'm wondering if i can create two registers with same name but with different size and different id. Example i need to create a MenuRegister with 40 elements and another with 10; I 'm using routines ...
2
votes
2answers
571 views

Cant see printf in mplabX IDE anywhere… Why?

I tried this in a function, but I dont see anywhere the result in MPLAB X IDE. Why? Where I can find the printed result? I am using pic32 Curiosity development board and XC32. int a = 5; int b = 10; ...
-2
votes
1answer
173 views

How to use const int inside typedef struct?

I'm using 'const int' and 'char const * const', to inform compiler that my value will never change. I need to succeed minimum program and data memory. typedef struct{ char const * const ...
1
vote
1answer
57 views

No rule to make target mbascii.c required by mbascii.o?

I opened a project from a colleague in mplab X, it was in an archive(.zip) I added to the original path where are all my projects and I added the correct path to Harmony, but this is the error when I ...
1
vote
2answers
116 views

Trouble Compiling my Microchip PIC18f4550 USB project using MPLAB X IDE C18 compiler. The compiler keep highlighting “syntax error” and won't compile

I am unable to compile my code using the MPLAB X IDE C18 Compiler. The link below is a link to my printscreen picture of the error.As you can see the IDE said that there is a syntax error at the ...
1
vote
1answer
156 views

shift register(74hc595) and pic in ccs

When I write 8 bit in hc595 shift register, with i2c last bit go to Q0 in second hc595. Why? Schematic: My code: i2c_write(0b10101010); latch_led_sensors_out(); delay_ms(200);
-3
votes
1answer
56 views

PIC programming in C: if any in list is true then

Newbie to C programming. I'm programming a PIC in MPLAB X IDE. How can create an if statement whereby if any items in a list are true then... else...? If [either a>10, b>10, or c>10] Then panic ...
2
votes
3answers
134 views

How can i create a truly random number in C (IDE: MPLAB)

I am making a game on a PIC18F2550 and I need to create a random number between 1 and 4. I've found out already that the rand() function sucks for truly random numbers. I've tried the srand(time(NULL)...
-1
votes
1answer
60 views

pic12f675 timer1 observation

I used TIMER1 in PIC12F675 with overflow interrupt and the time for over flow around 0.5 sec and in simulation its true the code of overflow interrupt FUNCTION : void interrupt int_tmr1(void) { if((...

http://mssss.yulina-kosm.ru