Questions tagged [mikroc]

mikroC PRO for PIC is a full-featured ANSI C compiler for PIC devices from Microchip®.

126 questions
7
votes
3 answers

How to avoid globals in this case (embedded C)

I'm still learning C to be used in microprocessors. In the beginning I used lots of globals. Now I'm trying to avoid it as much as a can, but for me it's not always clear to see how to do this. For example a battery monitor, in this case there are 4…
Benno
  • 149
  • 2
  • 10
6
votes
4 answers

Hex Decompilers for PIC

I've faced to a problem with a PIC Micro controller. I have a micro-controller programmed by me long time ago and I lost the relevant source code and the schematic diagrams. Now I need to invert the value of a port. I can do this using some NOT…
5
votes
3 answers

8051 microcontroller kit recommendation?

I'm a first year Computer Science student looking to get started with development for micro-controllers. I'd like to use the 8051, as it's common as dirt, and is used frequently in the real world. During my junior or senior year, I'll be taking a…
LucidDefender
  • 219
  • 2
  • 4
5
votes
8 answers

PIC16 C compiler

I am looking for a good C compiler for the PIC 16 family, working on Windows. A couple of colleagues use bknudc but some seem to dislike it. Apparently you cannot use the linker efficiently, and it turns out that the best is to set all code in…
Gauthier
  • 40,309
  • 11
  • 63
  • 97
3
votes
0 answers

How to read data from UART in MikroC

Anyone here using MikroC to implement UART? I'm trying to connect a PIC18F4550 and SIM900. I want to use UART1_Read_Text(variable, delimiter, attempts). But since there is no specific length of the text that will be received, I'm trying to use NULL…
Granger
  • 35
  • 1
  • 5
2
votes
2 answers

How do I receive a char array in a C function?

I wish to split a "string" by the character ','. The string holds a GPS NMEA encoded string, but that is of no matter. My problem is that sometimes the parameter from the function that processes this char array is empty... Like nothing is in the…
Fluffy
  • 23
  • 1
  • 7
2
votes
3 answers

Reading input pin of pic microcontroller with MIKROC

I need to write a program that will check if an input pin of PIC has a voltage. If a voltage exists then it will give voltage to a selected output pin like PORTB.RB1=1;. Else it will give voltage to other selected output pin like PORTC.RC1=1;. Is it…
Mushfiqul Tuhin
  • 666
  • 6
  • 13
  • 31
2
votes
1 answer

What is "Interrupt Context Saving" in embedded systems?

What is "Interrupt Context Saving" in embedded systems? I am configuring interrupt handlers in an IDE that I am new to. In the configuration setup it gives me the option of no context saving or "Auto" (Compiler chooses whether the context saving…
2
votes
1 answer

PIC16F88 all pins High

I have recently begun working with pic micro-controllers, and I haven't had that much trouble with the PIC16F877A series. But i found the PIC16F88 really troublesome. I don't know whether it is already a faulty IC(I just bought it), but after i…
2
votes
2 answers

how to optimize this code using c and pic16f84a?

I'm using mikroC to program pic16f84a, and i have the following function volatile unsigned short d; // global variable void put_data(){ RA3_bit = d & 1; d >>= 1; RA4_bit = d & 1; d >>= 1; PORTB.B0 = d & 1; d >>= 1; …
Rami Jarrar
  • 4,523
  • 7
  • 36
  • 52
1
vote
0 answers

Continuously changing PWM with ADC on PIC18F452

I am writing code for generating continuously generated PWM with a potentiometer.The code is given below. The code is working fine, but in some scenarios, it stops working. I get a changing PWM when I give 0–3 volts from the potentiometer. But when…
Zerox
  • 15
  • 5
1
vote
1 answer

Has anyone had success debugging a MikroE EasyMx board using the STM32CubeIDE?

I have recently bought a MikroE EasyMx Pro v7 board for the STM32 MCU, however, the compiler which MikroE uses for Arm Development is their proprietary MikroC compiler, which has hardly any tutorials on it. I was wondering if anyone has successfully…
lurence
  • 45
  • 6
1
vote
1 answer

convert decimal that is less than 1024 into two variable one with 8 bits and other with 2 using C

hi I'm programming a microcontroller using MikroC, and I have this variable which is less than 1024 (2^10bit) and I needed to convert that int value; to unsigned char value8bits; and put the least significant bits in the unsigned char value2bits; I…
Ismail Marmoush
  • 13,140
  • 25
  • 80
  • 114
1
vote
1 answer

Executing for specific period of time for 8051

Please give a favor, I am using MikroC compiler to write a program for 8051 microcontrollers, I am trying to find a way to execute and repeat the main program for 10 seconds, then stop for 2 seconds Code below just an example, I need to toggle …
Elia
  • 37
  • 1
  • 8
1
vote
1 answer

Receiving number of 3 digits from c# interface with PIC16F877 (MikroC IDE)

I am programming a dynamic C# interface to show real time states of my line follower robot sensors and motors. I am also sending a threshold of sensors to a microcontroller. Now I want to receive the threshold value with MikroC. My code is: char…
1
2 3
8 9