Questions tagged [mplab]

IDE for the Microchip PIC series of microcontrollers.

Integrated Development Environment for the Microchip PIC series of microcontrollers.

614 questions
2
votes
3 answers

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)), this is the main file #include…
niklas3524
  • 21
  • 1
  • 2
2
votes
2 answers

MPLAB X + XC8 break at wrong line

I've encountered a very annoying problem that has cost a lot of time for several months now. I have a project in MPLAB X. When I use a line-breakpoint it does not break on the right line at all when debugging my project. I am using MPLAB X…
2
votes
0 answers

PIC Header Files

I have trouble building my pic project. I used #include "p18f8722.inc" at the beginning of my .asm file but it gives the following error: can't open include file "p18f8722.inc": No such file or directory How can I deal with this issue?
newbiecomp
  • 21
  • 1
2
votes
1 answer

How can I add quotes to a char?

I need to add quotes in begging and ending of a char. char *Mychar = "hello"; printf("%c\n",Mychar[0]); My result is h and my desired result is 'h'.
user8978978
  • 101
  • 7
2
votes
1 answer

Data from UART to update an array

Hope someone can help me here. Fairly new to C (come from a PHP background) and been stuck on this problem couple days now. Still trying to get head round pointers etc, a joy PHP doesn't have. So basiclly, I want to be able to update a specific…
Steveo
  • 43
  • 1
  • 1
  • 4
2
votes
2 answers

using MPLAB's MCC to configure I2C and ADC

I am trying to communicate to BQ24259 through I2C using PIC16LF1554. The 7th register of the device has a bit which can be used to turn off the battery. I used Mplab's MCC to configure the I2C settings. Using the example code in header files i wrote…
aamir
  • 21
  • 4
2
votes
2 answers

How to speed up MPLAB X

MPLAB X takes 50 seconds to build, and more than a minute to program the PIC for debug after having built immediately before. Also seems slow when debugging. Will a multiprocessor pc run this program significantly faster, and what parameters should…
egginstone
  • 99
  • 2
  • 7
2
votes
0 answers

MPLab Harmony Servicing Multiple Clients

I'm very new to the TCP/IP stack from Microchip and I have succesfully created my own basic TCP server with the help of some of the examples in the Harmony folder. I would like to expand my TCP server to cater to multiple client connections on the…
R. Johnson
  • 102
  • 12
2
votes
2 answers

PIC18F2520 mplab x xc8 EEPROM

Platform MPLAB X CPU PIC18F2520 Compiler XC8 v1.38 We are moving a project from an old (htc) compiler to the MPLAB X platform but cannot access the EEPROM. The old compiler supported the eeprom_read and eeprom_write but XC8 does not, well, there…
user6127660
  • 31
  • 1
  • 4
2
votes
2 answers

Need to read analog input to a pic16f688 using mplab and xc8 compiler

I am using a PIC16f688 to try to read analog input and to turn a light on or off based on the voltage read. Using this PIC, I have successfully gotten the light to blink using on and off. Here is the code I used for that. void main() { ANSEL =…
2
votes
0 answers

MPLAB using external scientific library

I am using microcontroller from microchip and I am using MPLAB as my IDE tool. Now I would like to solve matrix problem called eigenvalues and eigenvectors of non symmetric 6x6 and 3x3 matrix. Based on this wikipedia article I have quite an option…
Nejc Okorn
  • 21
  • 3
2
votes
1 answer

How to use my MPLAB C32 compiler in Eclipse IDE

Can anybody let me know the procedures to configure the build settings in Eclipse(Helios) IDE for MPLAB C32 Compiler from Microchip?
Surjya Narayana Padhi
  • 7,741
  • 25
  • 81
  • 130
2
votes
1 answer

"Find Usage" feature stopped working in MPLAB X

All of a sudden the "Find Usage" feature in MPLAB X stopped working for me. This is strange for several reasons: It worked on the project I'm working on until my computer restarted (only event I can recall that may have cause a change) It works in…
NoS89
  • 81
  • 1
  • 10
2
votes
2 answers

Using enums and switch in functions (C18 Compiler)

I recently started rewriting a program to make it more easy to understand and I started using enums for describing the different states my program can be in. byte VoltageLimit(byte progState, word voltage) { switch(progState){ case…
Grossu Iulian
  • 275
  • 1
  • 2
  • 10
2
votes
1 answer

PIC 18F8722 variable declaration adresses

I know I can declare a variable in that way. variable udata 0x20 But what is the memory limit for this? Is variable udata 0x35 a valid instruction? I mean, can I use address 0x35? Is it spared to me, not SFRs? Also, how can calculate space…
mualloc
  • 495
  • 9
  • 24