mikroC PRO for PIC is a full-featured ANSI C compiler for PIC devices from Microchip®.
Questions tagged [mikroc]
126 questions
1
vote
2 answers
Pic programming: what is the variable type of a port bit in MikroC?
I'm programming in C in the MikroC IDE for a pic16f887 and I want more versatility with pins such as being able to put them into an array, passing them as arguments to functions...etc.
So I was wondering what the "type" of a pin such as PORTB.F1 is?…

Shubham
- 949
- 6
- 21
- 29
0
votes
2 answers
Software PWM on AVR using delay
I am trying to accomplish a simple PWM generation using delays on an AVR ATMega16
What i am trying to do is simply fade a led from 100% to 0% duty cycle, and later i will expand it to control two colors of a bicolor led to have a nice effect.
I have…

Dany Khalife
- 1,850
- 3
- 20
- 47
0
votes
1 answer
How to use Internal Clock of PIC
How to use the PIC micro controller's internal clock without using an external crystal?
Why most people prefer external crystals? Better if somebody can give a comparison
Thanks

Prasanna
- 4,583
- 2
- 22
- 29
0
votes
0 answers
I need help displaying data to an LCD using a PIC24EP512GU810 microcontroller
The LCD won't display anything no matter what I try.
I am trying to display data to an LCD using a PIC24EP512GU810 microcontroller. I know the bits are set to the correct pins for the LCD data because I have gotten characters to show up before with…
0
votes
0 answers
does PIC 16f877a external interrupt can affect all port?
the circuitI was working with PIC 16f877a and LCD, I want to powering a motor with transistor that used for relay with 9v battery and my LCD become error, does this because external interrupt?, because i used the external interrupt for a button on…
0
votes
1 answer
Proteus show characters on LCD ( LM015L )
I've been trying to show some characters on LCD ( LM015L ) but I wasn't able to do it.
I've written the following code in c:
// LCD module connections
sbit LCD_RS at LATD0_bit;
sbit LCD_EN at LATD1_bit;
sbit LCD_D4 at LATD2_bit;
sbit LCD_D5 at…

t3nsa
- 680
- 6
- 21
0
votes
1 answer
LCD I2C Interfacing With PIC16f877A
I am trying to interface an LCD using I2C but can't quite understand how to do it.
I found this example
Here's the code:
i2c.h:
/* File: I2C_LCD.h */
#define _XTAL_FREQ 16000000
#define I2C_BaudRate 100000
#define SCL_D …

TryingToLearn
- 1
- 1
0
votes
1 answer
UART communication between PIC and ARDUINO
I am trying to use ARDUINO serial monitor for my PIC microcontroller for debugging purpose, by connecting TX and RX pins of PIC with ARDUINO, I wrote the code for PIC16f877A, which indeed has hardware USART module, using Mikroc compiler, the…

Mufaddal Darbar
- 68
- 6
0
votes
1 answer
Unable to produce 1s delay using timer module
I am trying to generate a 1 second delay, using a timer module.
The value in the timer register is 61 DEC, which will generate an interrupt every ~50ms, which will increment the value of a variable named value.
After 20 interrupts ~1 sec will have…

Mufaddal Darbar
- 68
- 6
0
votes
0 answers
Interfacing LCD Nokia 3310/5110 with Microcontroller PIC16F877A
I have written the below code for interfacing my Nokia LCD with the microcontroller PIC16F877A.
I have downloaded the library file from Microelectronics website and pasted into my folder. However, I keep getting the below error messages from.
I am…

Oliver
- 1
0
votes
3 answers
An issue with uart and pic 18f452
i have a problem with pic18f452 and uart
i use simplest code like that:
UART1_Init(9600); // Initialize UART module at 9600 bps
Delay_ms(100); // Wait for UART module to stabilize
and between forever while loop i have…

Samy Massoud
- 4,295
- 2
- 35
- 48
0
votes
1 answer
How to access a specific element of an array in MikroC
I have this array in MikroC:
char array[4] = {'1','1','0','\0'};
I'm trying to get a specific element in this array and outputting it on a GLCD, let's say the first element. How can I do it? I know it should be something like that:
…

Doua Ali
- 175
- 1
- 5
- 21
0
votes
3 answers
Can you help me to do this algorithm "Shifting a String to right or left"
I'm working on a project implementing a clock using PIC18, LCD, ... etc and I am using mikroC to implement this project.
However, I am not good at C and I am stuck at certain point. The clock has a menu with several options that will enable the user…

Eng.Fouad
- 115,165
- 71
- 313
- 417
0
votes
2 answers
why does the 2nd statement creates Assigning to non-lvalue '' main.c?
hi whats the difference between these statements given below?
#define RES_WRITE 0Xf0f0
#define DATA (0x0000 |= (1<<15))
#define DATA (RES_WRITE |= (1<<15))
when DATA is assigned to a int variable it shows an error like "Assigning to…

y0g1nder
- 3
- 2
0
votes
1 answer
problem with IDEs which when you click on a line in editor, the cursor does't go to the last written character
I've seen a few IDEs like IAR embedded workbench or MikroC-pro from mikroelektronika, that when you click on a line, the cursor doesn't go to the last character. instead, it just sits right there on the white space. the problem seems to be same as…

Tirdad Sadri Nejad
- 149
- 10