Questions tagged [mplab]

IDE for the Microchip PIC series of microcontrollers.

Integrated Development Environment for the Microchip PIC series of microcontrollers.

614 questions
-1
votes
1 answer

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 output is only '13' then '133' and I am so confused…
T07
  • 43
  • 7
-1
votes
1 answer

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((PIE1&(1<<0))&&(PIR1&(1<<0))) //TMR1 OVERFLOW…
-1
votes
2 answers

How can i add values in array and the show it as one string?

I need to add same values on array and then to see it as one string. char txt[33] = ""; for (int i=0; i<4; i++) { txt[i]="A"; } LCDPutStr(txt,25); I get 4 characters but they are strange symbols. I need to take "AAAA".
MSD
  • 5
  • 3
-1
votes
4 answers

Const int to int doesnt work properly

If I convert const int to int inside a void it works. But when I create an extern const int it doesn't. void ReadFromEpprom() { int Start = 343; const int End=Start; //This works } Example 2 Header File extern const int End; Source file…
Dim
  • 41
  • 8
-1
votes
2 answers

How to configure correctly a PIC18 port D for output direction?

I'm developing a firmware to control a PIC18F45k80 pinout on a customized board. Before loading and programming this pic with the final version I was testing my program/debug environment (MPLABX IDE + Pickit3) with the simplest user code: toggle…
Suvi_Eu
  • 255
  • 1
  • 3
  • 16
-1
votes
1 answer

How to malloc a preprocessor directives

I have a macro as follow. #define WR_BLK_SIZE_REGINFO 123 Am using this macro in a library project(.a). Library projects are pre-compiled where the size of "WR_BLK_SIZE_REGINFO" cannot be changed as it is statically allocated in the library…
kaviarasan
  • 115
  • 2
  • 13
-1
votes
1 answer

Serial Port Terminal

I am programming a MAX32 Micro controller in MPLAB. I want to use the UART protocol to interact with my terminal (I am developing on a mac). Is this possible? Can someone point me in the right direction to get started?
user6509972
  • 247
  • 1
  • 4
  • 9
-1
votes
2 answers

PIC32 SPI not working

I'm trying to get the SPI working on a PIC32MX250F128D without much luck. I tried in 8 bit mode and 32 bit mode, but I'm not getting all the data or no data at all. I'm trying to use a 4MHz SPI to drive a WS2812 ledstrip. This is the code I…
-1
votes
1 answer

tm struct and MPLABX x8 compiler

I am trying to create a simple input to simulate Real Time Clock values. All I want the code to do is calculate to difference in time between the two tm structs (Time1Start and Time1End). The month, day, year, etc do not matter as these calculations…
Spiff
  • 1
  • 1
-1
votes
1 answer

C string to byte or binary (8 bit)

I'm looking for a simple way in C to convert an string to a byte or binary (8 bit). I'm always going to receive a string between 0 and 255, for example: If I receive "0", I want to convert it to 00000000 If I receive "255", I want to convert it to…
-1
votes
1 answer

PWM function keeps repeating I have no idea why

So I created this program in MPLABX, I am using it mostly to learn to code in C for future projects. I wanted to put some hardware/ register stuff into functions for neatness and ease of reading. For some reason my PWM function keeps repeating and…
TeslaCeph
  • 1
  • 1
-1
votes
1 answer

Installer for Microchip's 433.92 MHz Wireless Dev Board doesn't work

I can't install the USB drivers for Microchip's Wireless Dev Board. The part number is "DM182017-1" for this kit. I followed Microchip's instructions for downloading the USB driver, but the installer tool for USB provided doesn't work. To see these…
-1
votes
1 answer

Combine 4 chars into one unsigned long

I just want to combine 4 characters into one unsigned long variable as shown below. char y[16]; unsigned long Timer ; y[12] = '1' ; y[13] = '0' ; y[14] = '1' ; y[15] = '1' ; Timer = y[15] - '0' ; Timer |= (unsigned long) (y[12] - '0' <<…
Ammar
  • 1,203
  • 5
  • 27
  • 64
-2
votes
1 answer

Why is `extern` used in this MPLAB C example?

In the MPLAB XC8 Compiler User Guide, an example on page 162 (reproduced below) uses the extern keyword in conjunction with the @ specifier. Given that we are specifying the address ourselves, why is this needed? It's not going to be allocating any…
Sod Almighty
  • 1,768
  • 1
  • 16
  • 29
-2
votes
1 answer

PIC18 Signal Measurement Timer SMT1 (Counter Mode) Not Incrementing

I'm trying to use SMT1 on a PIC18F45K42 to count cycles of a square wave on pin RB0. I can't get the counter to increment, not sure what I'm doing wrong. If I understand correctly, SMT1TMR should be incrementing but it's not. (I also checked…
kjav
  • 93
  • 1
  • 7
1 2 3
40
41