Questions tagged [mikroc]

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

126 questions
0
votes
1 answer

My function solving for average value delivers random values

I'm using MikroC to try and program a PIC4550 to retrieve data from pH Sensor. The program consist of retrieving data 40 times and calculating its average value with function Average below double Average(int* arr, int number) { int i; int…
Granger
  • 35
  • 1
  • 5
0
votes
0 answers

error: (1089) recursive function call to "_forward_flight" XC8 compiler

I am trying to emulate a pingpong game with LED's showing the flight of the ball. Two players using buttons connected to RA0 and RA1 control the flight of the ball. Game starts with either pressing their respective button. I have two functions,…
Pako Moaro
  • 58
  • 7
0
votes
0 answers

GPS interface with 8051 UC

I am trying to extract data of Lat and Long sent by GPS module to the 8051uC. GPS received data looks like: $GPRMC,062637.000,A,2253.49272,N,07258.83129,E,,,270212,,,A*6970212,0.1,W,A*12 I need to write in the LCD the LAT and LONG, I started the…
Elia
  • 37
  • 1
  • 8
0
votes
1 answer

In MircoC Pro for dsPIC How can I setup the watchdog timer?

I need to set the FWDT to have the WDT be on, the prescaler be 1 and the postscaler be 12. I can't find any documentation on how to do this programmatically, or any way at all. I can see from the data sheet that I need to set FWDT, but I can't see…
Matt Ellen
  • 11,268
  • 4
  • 68
  • 90
0
votes
1 answer

Uart1 & Uart3 not working at same time in pic18fk67k40

I am using PIC18f67k40 with internal clock at 8Mhz (IDE 7.5). I did led blinking and simple UART1 transmit that works fine. Next while trying UART1 & UART3 at same time, only UART1 works... (UART1 init first then UART3 init) if i changes init order…
0
votes
1 answer

Problem with receiving correct integer from c# inteface

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. My code is: char uart_rd[10]; unsigned long v; while (UART1_Data_Ready()…
0
votes
0 answers

Have you ever interfaced a MAX44009 sensor with a uC?

I recently tried to program, using the free download version of MikroC for dsPIC IDE, a MAX44009 sensor to interface with PIC24FJ64GB002 microcontroller. The lux result of the sensor should be displayed on an LCD. The code compiles without failure,…
0
votes
2 answers

Button activated UART message

"I'm trying to use the button that when it is pressed, it triggers to send a string message via UART, but upon running the code, it always detect the button to be "always pressed" which is not ideal. I need help fixing my code. Thank you very…
Dorokun192
  • 63
  • 7
0
votes
0 answers

Connect 4 microcontrollers together using UART serial communication to a pc

**Is there a way for connecting 4 microcontrollers together using UART even if it has one UART module in each one of them(18f452) to send data from three of them to the master(18f4550) for display it on a pc switching using and gates…
Kakorotto
  • 1
  • 1
0
votes
2 answers

RBIE interrupt works only once - PIC16F877A

In my code, I have two interruptions, one is coming from the overflow of the TMR0, and the other one is when a button is pressed. this is the code in MikroC : int compt = 0; int seconds = 10 ; int enable = 0; void interrupt(){ if…
0
votes
2 answers

Why is my If statement not working properly?

So I'm building a simple MikroC program that sets PORTB.B0 if PORTA.B0 is equaled to 1 void main() { PORTA.B0=1; while(1){ if(PORTA.B0){ PORTB.B0=1; } } } However it doesn't give me anything PortB.B0 isn't equal to 1 only…
David Daniels
  • 131
  • 1
  • 7
0
votes
0 answers

How To Identify Error Points For Stack Overflow Is Forcing Device Reset Error In MikroC Code

Description: I tried to make a circuit using PIC18F4550 Microcontroller and MikroC Programming Language. This is my program sequence. There are 20 schedules to choose and each schedule have 6 timing values. This schedule number store in the…
Ind
  • 377
  • 2
  • 6
  • 16
0
votes
0 answers

Number conversion functionality

I have been trying to find some code to assist me with writing the program for my final project, but having troubles finding samples that are relevant enough to get me going. The program I wish to write will convert an input number from either…
0
votes
1 answer

Seven Segment Display Scrolling

I am coding SSD display using 2 cascaded shift registers. I am using a mikroC for PIC compiler. I can display a static sequence of numbers upto 4 digits with my code Static Display of 4 Numbers #define SHIFT_CLOCK PORTB.F1 //Clock Connection…
Ace
  • 11
  • 4
0
votes
1 answer

pic18f communicating with lcd module

I'm developing on a pic 18Fxxx (18F452) in assembly. I'm in a learning phase so I'm doing different simple exercise with the final goal to develop a "real" project. At the moment I'm stuck with the LCD Module, I couldn't find any examples of a…
Abaco
  • 525
  • 7
  • 26
1 2 3
8 9