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
1 answer

How can I use MCLR on a pic18f4550 using Proteus?

I'm trying to use Master clear(MCLR) on a pic18f4550 with Proteus, but whenever I press the button to do so, the red and blue dots that represent on and off in Proteus turn yellow and the LED doesn't turn off. I'm trying to replicate a Proteus file…
-2
votes
1 answer

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 Name[2]; const int MaxValue; …
drs
  • 133
  • 1
  • 11
-2
votes
1 answer

Not Equals Operator not working when interrupts are enabled on PIC32

I am currently trying to parse a string received via UART from a GPS module on a PIC32MZ2048EFG100 micro-controller via a UART receive interrupt protocol. I am using MPLAB X IDE v4.10 and XC32 v2.05 for my IDE and compiler. When I enabled the UART4…
K. Crow
  • 1
  • 2
-2
votes
2 answers

Statements on "if" not followed

I´m doing a little programming on C with a dsPIC, I have found a little tiny problem that I don´t know why or how is it happenning. Compiler C30 for MPLAB I have this code: int Function1(){ . . . while(1){ . . . P1 = EPC96_1[18]; //Here the value…
-2
votes
2 answers

Connecting multiple devices

i have a bit of a tricky question. My case is this: I have to handle a large amount of PCB (up to 20) with some hardware and a PIC24FJ128GA306 the microchip only comes with a bootloader, and i want to upload my configuration to all of them either…
Claudi
  • 125
  • 1
  • 1
  • 9
-3
votes
1 answer

P18F4420 Switch case statement in PIC assembly language

Im using a PIC18 on Mplab IDE in Assembly language where I have four LEDs. 2 LEDs tell me the status #1 and the 2 other LEDs the status #2. Finally, I have 2 more output LEDs to tell me the status of these 4 LEDs based on their status. This can be…
Citi
  • 47
  • 6
-3
votes
1 answer

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 10 in decimal, so in the file register show 0A…
-3
votes
1 answer

Include one character with two digit value

The code below show, to check the digital output at PORTB on the hardware. That PORTB have UI1-UI12. When it is not shorted, the value will be 1. So if nothing shorted, when i write UI5-UI7 in Hyperterminal it will show 0x03 (111bit in binary) Here…
athirah
  • 17
  • 5
-3
votes
1 answer

How to convert unsigned to signed char (and back) while preserving range in C?

I have a situation where I need to convert an unsigned char (0-255) to a signed char (-128-127). I want to have 0 converted to -128, 127 converted to 0 and 255 converted to 127. I currently am using this code to do this (even though it won't…
lopsided98
  • 559
  • 1
  • 9
  • 18
-4
votes
1 answer

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 Else carry on Do I really have to right the block of…
JJJ
  • 9
-4
votes
1 answer

PIC18F2220 LED blinking program error

I am a beginner in PIC programming. This video I have used to code my first program. This is the code I have written: #include #include #include "XC8.h" void main(void) { TRISBbits.RB0 = 0; OSCCON = 0x76; while(1) …
vt673
  • 127
  • 1
  • 6
-5
votes
2 answers

How can i place % symbol after an interger

I need to print a string with an integer an the symbol % after it. Here is what i try: sprintf(txt, "%d",CurrentArrayValue,'%'); But my result is only my number. None symbol after that
MSD
  • 5
  • 3
-5
votes
1 answer

How to insert for loop in void function?

is there possible to insert for loop in void function ? void decode(unsigned char* msg) { int result[5];// can store our value unsigned char lala[50]; if (strstr(msg, "UI01?") != msg) // write in Hyperterminal { …
Nazif Jaafar
  • 21
  • 1
  • 11
1 2 3
40
41