Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
98 views

I'm using a PIC18F microcontroller with mikroC PRO for PIC. The PIC micro reads strings over the UART, which Software implemented because there is only one UART, and I need two. I'm trying to write a ...
Isay's user avatar
  • 9
0 votes
2 answers
459 views

Using Indirect addressing I'm trying to copy the value 77H into RAM memory locations 50H to 55H. The issue I'm running into is a build error where it says FSR and INDF are not previously defined ...
Matt Bennett's user avatar
0 votes
2 answers
2k views

When programming my PIC18F6722 using MPLAB IDE v8.91 (the 32bit version), my PIC works and starts successfully, but when I use the HEX generated from MPLAB IDE, but program it using MPLAB X IPE, the ...
B.Adlane's user avatar
0 votes
1 answer
107 views

trying to compile a code but keep giving build failed and checking red flags shows only Unable to resolve identifier in RBIE and RBIF. below is the code i have im using it with a pic18f45k50 with a ...
eduardo de la torre's user avatar
2 votes
1 answer
1k views

I am trying to add a simple led application to a PIC18F25Q10 in another circuit using the Curiosity HPC development board. I am using the MCLR, PGD, PGC and GND pins. Although I set the LVP mode to ...
fthelb's user avatar
  • 23
0 votes
0 answers
123 views

I am using pic18f and coding on mplab v ide. While compiling the code it's showing that 'RD3' is depricated. What should be the solution to it.
shashi singh's user avatar
1 vote
2 answers
902 views

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 ...
Koh Yi Min Jason's user avatar
1 vote
0 answers
403 views

I have been wanting to use the C18 Compiler on MAC OS X for a long while for my MPLAB projects, (so as I can use the mdd library), but it isn't available except for Windows. So I have installed Wine ...
CN railfan's user avatar
2 votes
2 answers
287 views

I've this array below: dataIn[5] = 0x88; dataIn[6] = 0x2A; dataIn[7] = 0xC7; dataIn[8] = 0x2B; dataIn[9] = 0x00; dataIn[10] = 0x28; I need to convert those values to decimal because after that I need ...
Pedro Junior's user avatar
0 votes
2 answers
262 views

I am working on a project on which i need to send data over USART to terminal. I need to display the data as the numeric value (0-255) of the char (which collected from the EEPROM i have managed to ...
RobinHud's user avatar
3 votes
2 answers
557 views

When writing code in C, I often include const in function parameter declarations in the function's definition, but not its declaration: int func(int arg); ... int func(int const arg) { return ...
thetic's user avatar
  • 193
2 votes
2 answers
2k views

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 ...
Grossu Iulian's user avatar
2 votes
2 answers
4k views

I want further understand the difference between XC8 & C18 compiler. I know that XC8 is the latest compiler for all 8-bit microchip controllers. e.g. PIC16F, PIC18F. And C18 is the compiler for ...
TJCLARK's user avatar
  • 519
0 votes
1 answer
1k views

I commonly see the following lines of compiler-related codes : #if defined(__18CXX) ... #endif and #if (defined(__PCB__) || defined(__PCH__) || defined(__PCM__)) ... #endif How can I know the ...
Wazani's user avatar
  • 911
0 votes
1 answer
1k views

I am trying to assign values in main program. typedef struct PointStructure { unsigned char x; unsigned char y; unsigned char offset; unsigned char page; }point; volatile far ...
Dolphin's user avatar
1 vote
1 answer
3k views

I am new to C programming and microcontrollers. I am using a PIC18F24K20 microcontroller with C18. I have it set up to receive information from a computer input using USART transmit and receive ...
user3115691's user avatar
0 votes
1 answer
92 views

I am using microchip c18 and i have this function which splits the float in to 4 respective bytes.And C18 follow little endianess a[0]=*(fptr); address 0 a[1]=*(fptr+1); 1 a[2]=*...
Rookie91's user avatar
  • 267
0 votes
1 answer
148 views

I have an array stored in EEPROM Starting with {0,0,0,0,1,1,1...} up to 54 elements from address '0'-address'53' and i have cross checked the value and everything is fine. but when i employ a '...
Rookie91's user avatar
  • 267
0 votes
2 answers
658 views

I am currently working on a project to select different outputs based on a text input from a laptop via USB. What I am currently trying to do is send a character out from my PIC18F1320 to ...
user2887182's user avatar
2 votes
2 answers
3k views

I am struggling to understand why I get random data while trying to read from multidimensional table that is stored in rom. I have a table of bitmap character which I want to display on OLED screen. ...
user2771538's user avatar
4 votes
1 answer
8k views

I have following function to compare two char arrays in C: short test(char buffer[], char word[], int length) { int i; for(i = 0; i < length; i++) { if(buffer[i] != word[i]) { ...
CAPS LOCK's user avatar
  • 2,040
0 votes
1 answer
91 views

I've been trying to declare an array as global in mplab c18 and never found much success. Is there any possible way to access the array elements, or can we declare the array as global /extern and ...
Arun Nr's user avatar
  • 31
0 votes
2 answers
4k views

I'm using a PIC18 with Fosc = 10MHz. So if I use Delay10KTCYx(250), I get 10,000 x 250 x 4 x (1/10e6) = 1 second. How do I use the delay functions in the C18 for very long delays, say 20 seconds? I ...
Michael Reed's user avatar
1 vote
1 answer
639 views

I got a syntax error when trying to compile this macro. I have to use a macro as C18 doesn't support function inlining. Using a regular function call will cause the compiler to have a much bigger ISR ...
serenity's user avatar
1 vote
1 answer
4k views

I'm trying to compile and link a C program using the XC8 compiler. I changed from the C18 compiler and made some minor compatibility changes to the code. With C18, the code compiled and linked just ...
user avatar
2 votes
1 answer
2k views

I'm compiling my C code using Microchip's C18 compiler. I'm getting a warning [2054] suspicious pointer conversion in this code: unsigned char ENC_MAADR1 = 0x65; unsigned char ENC_ReadRegister(...
user avatar
2 votes
2 answers
1k views

I sometimes see this in a C program (I'm using the C18 compiler): unsigned char someValue = getSomeDataFromSomewhere(); if (someValue) { doStuff(); } else { doOtherStuff(); } I know what ...
user avatar
0 votes
2 answers
631 views

Is there a way to let the C18 compiler throw an own, customized error message during compiling? For example, consider a situation with two user-defined settings: #define SETTING_A 0x80 #define ...
user avatar
3 votes
1 answer
589 views

I'm looking for a way to make Jalv2-like pseudo variables in C using the C18 compiler. A pseudo variable is something that acts like a variable but actually is a function. In Jalv2, it's possible to ...
user avatar
2 votes
1 answer
2k views

Ok, I've been trying to solve this issue by my own for long time now, and I simply give up. I've searched through all the web until I couldn't take it anymore and I need help! I read the whole "C18 ...
john1034's user avatar
  • 128
0 votes
1 answer
120 views

Iwould be most grateful if your experts on using the C18 compiler could give me a pointer as to what I am doing wrong. To become familiar I started a simple thermometer project:- NTC thermistor --> ...
Fred Mah's user avatar
0 votes
1 answer
400 views

I'm building a 16 state FSM on a PIC18 with C18. I'm considering having each state as its own function which jumps to and gets jumped by other states. I'm tempted to just write a branch cases of "...
BB ON's user avatar
  • 260
0 votes
1 answer
479 views

Stackoverflow, you've helped me before, I think I need your help again. I'm trying to bit-bang my own serial out using a GPIO on a PIC18F2550. This connects to some shift registers (3x74LS595), where ...
BB ON's user avatar
  • 260
2 votes
1 answer
1k views

I am trying to pass a String to a function. I have read a lot about RAM/ROM Strings in C18 and my code seems ok but it is not working. My function is like this: int setBluetoothName (static const ...
Andres's user avatar
  • 6,190
1 vote
0 answers
928 views

I'm having trouble with a project using a PIC 18F87J50, specifically in my coordination with its 2 USART channels. There are 2 main problems. 1.) Unable to set target Baud Rate: I'm using the ...
Dave Masselink's user avatar
1 vote
2 answers
1k views

In many languages, such as C++, having lots of different source files is normal, but it doesn't seem like this is the case very often with PIC microcontroller programs -- at least not with any of the ...
Nate's user avatar
  • 29.1k
3 votes
1 answer
3k views

I'm doing a project using the Microchip C18 compiler. I have a struct called a block that points to other blocks (north east south west). These blocks will make me a map. I then have a pointer that I ...
Cal Pratt's user avatar
2 votes
1 answer
796 views

I am working an embedded project which involves reading/writing a struct into EEPROM. I am using sprintf to make it easy to display some debugging information. There are two problems with this code ...
dantheman's user avatar
  • 275
0 votes
2 answers
388 views

Hi there stackoverflow. I'm working with pic 18f4550 with bootloader. Because of the bootloader i need to start de code in a specifed address in the memory. In this case 0x1000 because i dont have ...
Etraud's user avatar
  • 19
1 vote
2 answers
2k views

I want to compare two strings: The first string is declared above my main: char _newState[] = "AVAILABLE"; When I want to compare with a const string, i put the line: if(strcmppgm2ram((const char *)...
user1466676's user avatar
11 votes
2 answers
40k views

I have a folder with some .h and .c files and I want to use header files in my projects. I have included them in "Header Files" folder of my project using "Add Existing Item" but when i try to "#...
blow's user avatar
  • 13.3k
2 votes
1 answer
2k views

I'm trying to compile some code for basic USB HID functionality. I'm using a PIC18F14K50 with MPLAB 8.43 and the Microchip C18 compiler. I'm using some standard files from Microchip's website. Here is ...
Ozzah's user avatar
  • 10.7k
2 votes
4 answers
2k views

This is the first time I'm using macros in C and I'm trying to replace a large section of code that I'd normally place into a function with a macro. This is a part of an interrupt which will be used ...
AndrejaKo's user avatar
  • 1,745
2 votes
0 answers
771 views

Someone knows a way to declare a naked function on C18 compiler? By naked function I mean function without any epilogue and prologue. in gcc I use: __attribute__((naked)) int func(int par1) Maybe a ...
Gustavo Vargas's user avatar
3 votes
2 answers
296 views

Library.h void Foo1(void); // Unused int Foo2(int, int); // Used char Foo3(char); // Unused main.c // ... #include "Library.h" // ... void main(void) { int ret; // ... ...
hkBattousai's user avatar
0 votes
1 answer
1k views

Is a special representation needed for long and float numbers in the code? In computer programming with C/C++ we put an f letter after a float typed constant number to distinguish it from double type....
hkBattousai's user avatar
2 votes
4 answers
27k views

I'm programming on a MCU with C and I need to parse a null-terminated string which contains an IP address into 4 single bytes. I made an example with C++: #include <iostream> int main() { ...
BETSCH's user avatar
  • 103
0 votes
3 answers
2k views

I am using PIC18F2550. Programming it with C18 language. I need a function that converts double to string like below: void dtoa( char *szString, // Output string double ...
hkBattousai's user avatar
2 votes
2 answers
3k views

I have a very elementary question. However, what ever I tried, I couldn't successfully implement this. I have a shift register (74LS164) connected to PIC18F2550 with the following hardware ...
hkBattousai's user avatar