mikroC PRO for PIC is a full-featured ANSI C compiler for PIC devices from Microchip®.
Questions tagged [mikroc]
126 questions
1
vote
1 answer
Appropriate sample for PIC ADC after converting from analog voltage.
if I'm reading an analog signal from my pressure sensor at 500mSec. my instructor told me that you should make the ADC Timr0 interrupt double what you are reading from analog Oscilloscope (500mSec.).i.e. 2fc. My code is down below.
Should I…

Ahmed A
- 71
- 1
- 9
1
vote
0 answers
LCD not working properly with PIC16F877A using mikroc development
I've been designing a simple traffic signal code using a PIC microcontroller, it's supposed to have a control panel with which you input the timing for each traffic light, to make it more secure I added a password to stop anyone from messing with…

Osama Yousry
- 11
- 5
1
vote
1 answer
mikroc pic16f877A timer code not working
i wrote a code in mikroc for pic16f877A in which i have used a timer0 and timer1.
i debug my code and found that timer0 is not working but i am not able to understand the reason behind it. I even checked datasheet for the OPTION_REG
but couldn't…

sharan choudhary
- 11
- 2
1
vote
1 answer
PIC MikroC - Making a 2x2 Keypad Scanner
I am creating a 2x2 Keypad Scanner where RC0 and RC1 are input lines, and RC2 and RC3 are output lines. I have set TRISC as follows
TRISC = 0b00000011;
I have then created the keypad scanner method
char keyPadScanner(){
PORTC.RC2 = HIGH;…

Joeliomason
- 159
- 2
- 16
1
vote
0 answers
MikroC PIC18F27J53 strtok
I've got a problem. So i'm using strtok on strings with the same syntax, when i strtok the first string, it's ok, no problem, but when other strings comes in strtok doesn't work. It can't split up my string at the commas. Here's the code:
…

tamasJozsa
- 86
- 1
- 12
1
vote
1 answer
MPLAB code not working
I am working on pic microcontroller programming and went lately to lcd made 2 codes, one in mplab and the other in mikroc actually both worked in isis but when I tried it in real only mikroc code worked in the microcontroller I don't know actually…

user3674628
- 29
- 12
1
vote
1 answer
The execution of the code always goes into the else statement
Some very strange things happen in my source code.
The following function works well and it prints 'y' when the password is correct and prints 'n' when it is incorrect. But if i add some UART1_Write and Delay functions to the else statement the bug…

Ted Tedson
- 316
- 1
- 6
- 15
1
vote
1 answer
Receive data via uart for pic16F788 :mikroC
I've written the java code to send data to pic via serial port and now I need to program the microcontroller to read the data and make PortD.RD6=1 if the it receives 1 and PortD.RD6=0 if it receives 0. I've tried this code but I get many errors…

user3475463
- 45
- 2
- 9
1
vote
1 answer
UART pic18 to pic18
Cant send character 'C' and display on receiver pic. LCD prints some special characters, no 'C'... ;(
Transmiter:
char uart_rd;
int uart_rdi;
sbit LCD_RS at LATB0_bit;
sbit LCD_EN at LATB1_bit;
sbit LCD_D4 at LATB5_bit;
sbit LCD_D5 at…

Vadimas Sizikovas
- 74
- 1
- 11
1
vote
2 answers
PWM resolution in pic 16F877
Here I'm using pic 16f877 MCU and mikroc for pic compiler to understand PWM signals.
The data sheet says that this MCU is having a 10 bit resolution in PWM. I cant understand what this resolution means. Does it mean that if I use it to power a motor…

danial weaber
- 846
- 2
- 17
- 37
1
vote
2 answers
PIC 18F46K22, MikroC: 'Multitasking' simple and time consuming task
I'm receiving a UART message containing an array of raw sensor data. I'm reading the message within the main loop of the program. There are 2 things I need the PIC to do with the different values. Display it on a LCD (somewhat time consuming) and,…

Felix
- 89
- 1
- 12
1
vote
0 answers
PIC 18F46K22, MikroC: Trying to implement USART interrupt
I have two 18F PICs working next to each other. One is requesting data over UART from another source, their both receiving the (same) incoming data.
The first PIC (18F4450) which is requesting the data works fine, but on the second PIC (18F46K22)…

Felix
- 89
- 1
- 12
1
vote
1 answer
Does rand() function exist in mikroc?
How can I implement the rand() C++ function in mikroC?
I tried rand() but does not work... I don't know how to resolve this

Zolyboy
- 457
- 7
- 17
1
vote
1 answer
spi interfacing between two microcontroller in mikroC
I'm doing spi interfacing between two pic18F452 microcontrollers in mikroC but my program doesn't give any output. I send a data from Master and slave have to display it on LCD.
Here is my code for both master and slave:
MASTER CODE:
unsigned…

zahra
- 11
- 1
- 2
1
vote
2 answers
Could not call the sub-routine correctly Microcontroller PIC18F
I have a project to program a microcontroller PIC18F, I have to connect a switching circuit to the microcontroller board, this switching circuit has an electric lock and a buzzer to be connected to it.
The lock is initially powered. It is supposed…

Sahar Nadi
- 23
- 3