-
Search Results
-
Topic: PIC16F877A Stack problem
MikroC compiler gives following message,
Not enough RAM for call stack __Lib_Delays.c
how to solve this problem.
How to create “us” variable delay in MikroC
Topic: MikroC OneWire Example Help
I would like to know why are they adding 48.
// Convert temp_fraction to characters text[4] = temp_fraction/1000 + 48; // Extract thousands digit text[5] = (temp_fraction/100)%10 + 48; // Extract hundreds digit text[6] = (temp_fraction/10)%10 + 48; // Extract tens digit text[7] = temp_fraction%10 + 48; // Extract ones digit
Thanks for your help 🙂
Topic: PWM by pic 16F877A
Hey guys,
I am using 16F877A to output PWM, increasing and decreasing it via two push buttons its based on the code used in DC Motor Speed Control using PWM with PIC Microcontroller in MikroC but the problem is that after a certain PWM value the PWM will not decrease and I have also added a switch with instantly makes duty value zero but it also doesn’t work after a certain pwm value and I have tried it on Proteus as well as with leds in real life but they give the same result. Only way it goes low is to keep pressing the UP button then some how it come down to a low value then other two switches start working and I then can switch it pwm off. Don’t know whats wrong.
Here is the code:-
{ adc = ADC_Read(1); // Get 10-bit results of AD conversion rpm_temp = adc * 2; //converting analog value to rpm WordToStr(rpm_temp, speed_out); //converting integer to string to disply on LCD Lcd_Out(2,9,speed_out);//Write speed in 2st row 6th col Delay_ms(100); if (RD0_bit ==0 && duty<250) //if button on RD0 pressed { Delay_ms(100); duty = duty + 10; //increment current_duty PWM1_Set_Duty(duty); //Change the duty cycle } if (RD1_bit ==0 && duty >0) //button on RD1 pressed { Delay_ms(100); duty = duty - 10; //decrement duty PWM1_Set_Duty(duty); } if (RD2_bit ==0 && duty >0) //button on RD2 pressed { Delay_ms(100); duty = 0; //reset duty PWM1_Set_Duty(duty); }Topic: USART PIC16F877A
I have used the c code for the USART module from the tutorial. I can not get it to work. I am using MikroC Pro with the EasyPIC 7. I know the compiler has its own function for initializing the module but I would like to write my own. Please help.
I want to display data read from UART on 16×2 LCD with MikroC compiler & PIC16F877A microcontroller …
In my program I am sending data through USART terminal of MikroC, it is receiving correctly on virtual terminal in Proteus but not displaying on LCD.
Please check the code written in MikroCsbit LCD_RS at RB0_bit; sbit LCD_EN at RB1_bit; sbit LCD_D4 at RB2_bit; sbit LCD_D5 at RB3_bit; sbit LCD_D6 at RB4_bit; sbit LCD_D7 at RB5_bit; sbit LCD_RS_direction at TRISB0_bit; sbit LCD_EN_direction at TRISB1_bit; sbit LCD_D4_direction at TRISB2_bit; sbit LCD_D5_direction at TRISB3_bit; sbit LCD_D6_direction at TRISB4_bit; sbit LCD_D7_Direction at TRISB5_bit; char gps; void main() { Lcd_Init(); Lcd_Cmd(_LCD_CLEAR); Lcd_Cmd(_LCD_CURSOR_OFF); Lcd_Out(1,1,"log"); Lcd_Out(2,1,"lat"); UART1_Init(9600); here: if (UART1_Data_Ready() == 1) { // if data is received gps = UART1_Read(); delay_ms(100); } Lcd_Out(1,6,gps); Delay_ms(2000); goto here; }
