Search Engine

Delay Function Timer Pic C

Add Question

24 Threads found on Delay Function Timer Pic C
Hi, Here the example of C18 MPLAB compiler code to generate delay using timer 0: Void delay() { T0CON=0x08; TMR0H=0x35; TMR0L=0x00; T0CONbits.TMR0ON=1; while(INTCONbits.TMR0IF==0); T0CONbits.TMR0ON=0; INTCONbits.TMR0IF=0; } I want to write the same code using CCS compiler without using built in (...)
Hi. pic12F629 works from 2.0V to 5.5V. You can use delay function of C compiler or timer(if you want precise pulse with) Best Regards.
Hi, The timer in 16F84 is 8-bit, so it can count only up to 255. With a clock of 4MHz (1MIPS carryout), you can only have a delay of 256 microsecond. Prescale that to 256, and you get 65.5ms. So you need to check for the delay MANY times. It does not seem feasible. So, I think you should use a software loop for the 8-hour (...)
Hai experts , i want to know how to create one second delay in 89s52 IDE is Keil ? please give the calculation if you have thanks
Please check my code and circuit. Question is that I want to make digital clock 4-digits for Hours and Minutes.The minutes digit increase after every 60 secs and hour digits increase after every 60 mins but problem is that if i add delay() function for 1 sec the display off and on and cannot display without flickering how to avoid this problem. P
if precision is not necessary you can use delay loops...or you can use clock ic like ds1307..but you can do this easily 16f628(timer1 working in32.768khz)...
Hello guys, i am newbie here, was doing a project regarding infrared sensor autogate... what i wish to ask is how to write the command for the situation stated below? When a IR receiver received a signal from IR transmitter for more than 3 sec, only the DC motor will move CW or CCW? else, the motor will be remained sta
You can put output from encoder to interrupt pin and detect state change. So you can meassure time between pulses to get rpm and use PID algorithm for motor speed control. You can also put timer on overflow on 1/10s and count number of pulses in that time period to calculate RPM. In this manner you will have time delay of 1/10s for feedback but in
i am trying to use AT25256 SPI eeprom with pic 16F917. i thing the bug is in read function. The SPI clock and DATA is visible on CRO. i am not sure if it is correct. do not have a deep memory scope. can some one please help. this is the code in main() # include # include "pic_function.h" # include (...)
Try this this delay works with timer 0 and generate for 1 second and for your delay just change the values of TL0 and TH0, and check the result in performance analyzer in keil.... void timer() // timer function { unsigned int loop; { for(loop=0;loop<=40;loop++) //for 1sec. { (...)
hi first of all the built in delay functions are not accurate.the same case with internal oscillator also because the atmosphere can change the frequency of the internal oscillator.if you want accurate delay of 1 second,use external oscillator and timer. regards ml
I may be offtopic, but is not a good practice to use delay to perform a wait function. There is prefereable to use a timered interrupt flag instead. This concept ( is not, but ) is somethink more close to multitask processing, sometimes called time slot. +++
To genarate pulse for servo, need PWM at 50Hz. pic16 can't use PWM module. Use delay function also, not good for many servo. Other way, you can generate PWM using timer Interrupt. See example servo. or You can use Servo Controller that use UART to set servo position like this product, [URL="ht
I prefer the polling method, use a timer to check a few times per second if anything has been pressed, as a bonus there is no need to debounce the keys. Note what I said, all you need is to check 5-10 times per second, you have an mcu that can execute millions of instructions so having it spend a hu
hello i try to read ADC at pin AN0 from a potentiometer and display the digital measurement.the max output voltage of the potentiometer is 5V and to get the digital measurement=vin/5x1023...but then at my lcd show measurement 255 instead 1023. from datasheet, the pic is 10 bit. please explain to me why this happen???
If you aren't going to be doing anything during that long period, you can use software delay, using the delay_ms() function and for loop. If you are going to be doing something during that period, you need to use timer as Oyvind has said. I don't know which pic you'll be using. But you can use (...)
Give some delay after the lcd_init() function. This gives some time for the LCD to initialize. About 10ms-50ms would be enough. This us usually the problem when we see the LCD fully lit up with all black rectangles.
hi, i want to make a digital clock, for which i have written my code on 8051 micro controller, now when i simulate my code on Proteus, it gives the error and not working properly. i am attaching my code and Proteus pic with this post. please help me.. #include sbit dig_ctrl_4=P1^0; //Declaring control pins of the
Is it true that adding one more data byte stops USB device operation? I rather guess it's the call to commandServoToAngle1(), that further increases software latency and possibly exceeds the maximum allowed delay to service the USB. The delay loops are a "rusty" method to generate servo pulses, you should better think of a solution based on har
pre scale a timer and start it at the beginning of the program. read the overflow bit in the ISR.once overflow happens jump to your subroutine.if the timer value loaded is not enough, write a logic in the ISR such a way that it makes up the delay you wanted.
PWM is normally used for speed control od if you wnat to generate for that purpose then good PWM frequency will be 1KHz or its simple to write a C program for pic using timer to generate variable pulse widths controlling speeds... you can also use ur own made function for time delay..... here is a general (...)
I have a assembly with a temperature sensor. is another problem. The picture is attached to my display. no temperature. problem is the source code? I can help someone the code is : //program for temperature monitoring system written for pic16F877A // //author: keshava murali // //version1 // //bellow 30sC LED switches OF
Dear spiba, this is not the practical way of writing a code for 50hz inverter, it involves much more critical math calculation and different technique to perform the job properly. As you ask how to start, this is an example to get 50hz squire wave with 50% duty cycle. On the second question, no you do not have to used pwm/ccp but most people will u
Guys, I tried to write this code, but can't see LED blinking on pic IDE simulator Do you know why ? Thanks #include #include <delays.h> #pragma config FOSC = INTOSCIO_EC //Internal oscillator, port function on RA6, EC used by USB #pragma config WDT = OFF //Disable watchdog timer #define (...)