55 Threads found on edaboard.com: pic18 Timer
Boolean Timeout; // Flag. If true, do whatever you want after the timeout.
static int8 gtimer0_overflow;
if (--gtimer0_overflow == 0)
Timeout = TRUE;
In your main code, you have to setup the timer0, initialise the global variable (...)
Microcontrollers :: 05.05.2005 16:39 :: lguancho :: Replies: 6 :: Views: 1941
Does any body know a good pic18 development kit with:
-LED (at least 1)
-ADC (at least 2)
-RS485 (at least 1)
-C compiler and C example code for digital I/O, ADC, RS485, EEPROM, timer included
Thanks for reading
Look at at MMH-pic18
Microcontrollers :: 18.04.2010 15:26 :: yosibv :: Replies: 11 :: Views: 2844
I am using a pic18F24K20 and would like to know how to set up timer1 and the interrupts. Does someone have an example I can work from?
Microcontrollers :: 15.02.2010 18:42 :: RandyB :: Replies: 4 :: Views: 4092
pic18 unlike AVR does not have Clear timer on Compare in timer 0, but only in timer 2. T0 is a 16-bit timer (you can configure it for 8-bit if you want). So it counts from 0 to 65535 and then back to 0.
I gave 0xF82F to TMR0 (H and L), so that means I preloaded it with 63535. So T0 starts counting (...)
Microcontrollers :: 23.02.2010 12:59 :: Tahmid :: Replies: 10 :: Views: 4449
Hi, why do we need to set the configuration as follow most of the time? whats the story behind? can anyone tell me here? thanks
#pragma config LVP = OFF
#pragma config WDT = OFF
Microcontrollers :: 14.03.2010 11:09 :: scdvom :: Replies: 2 :: Views: 624
am currently working on a project which makes use of mma7260 accelerometer
I want to find out the vibration frequency using accelerometer to monitor
the hardware used here is accelerometer mma7260 with pic18F452
compiler is mikroC pro for PIC
The zero offset voltage out of mma7260 is typically 1.65 Volts,
i want to d
Microcontrollers :: 24.05.2010 07:55 :: amitrana3348 :: Replies: 4 :: Views: 1442
I'm using a PICDEM USB mounted with pic18F4550 and I'm using the C18 compiler. I
want to measure a certain period of time at one of the PIC's inputs, lets say between a falling edge and a rising edge. so what i need to do is to store the value of a "timer" at the falling edge moment and store it again at the rising edge moment and do
Microcontrollers :: 26.05.2010 07:50 :: Anthony_87 :: Replies: 2 :: Views: 773
please help me to design a system using pic18 microcontroller that base on the current mechatronics product available in the market. my design shuld use interrupt peripheral, whit at least three of the following item:
1) hardware timer/counter
2) analog to digital converter (ADC)
4) relay/valve/ moto
Microcontrollers :: 22.08.2010 00:34 :: noman87 :: Replies: 6 :: Views: 1576
Hi there , I am in a midst of a project and has some question to ask about
This is what one of the function that I would like to carry out in a micro controller and I would like to know whether it is workable and if it work , how do I go about doing it.
Lets make the delay as 2 second.
lets take the () bracket as the delay
Microcontrollers :: 11.01.2011 04:52 :: Darkbyte :: Replies: 1 :: Views: 706
Here are a few tutorials which cover the pic18F timer modules:
Introduction to pic18′s timers ? PIC Microcontroller Tutorial
Microcontrollers :: 08.01.2012 10:26 :: bigdogguru :: Replies: 3 :: Views: 881
Hello and Salam (if you're ******)
Base on frequency meter code by Rajendra Bhatt of embedded-lab.com, I made a tachometer reading using pic18F458 timer0 (configured to 8 bit and read from RA4 pin) but before making the actual circuit, I had it simulated using Proteus. Here's the code
sbit LCD_RS at RC2_bit;
sbit LCD_EN at RC3_b
Microcontrollers :: 01.05.2012 04:10 :: shapa2011 :: Replies: 4 :: Views: 393
If I understand your question correctly you want to know why interrupt Flag will become 1 right....
First all one need to think about the concept of interrupt timer ....Now in this case timer is free running block in the micro controller (PIC micro-controller ) In this case what happens It sources the clock from the micro-controller based on t
Microcontrollers :: 19.07.2012 01:00 :: milind.a.kulkarni :: Replies: 3 :: Views: 339
There are several "timer" tutorials available online as well as documentation concerning the topic:
timer0 Tutorial (Part 1) - Microchip
timer0 Tutorial (Part 2) -
Microcontrollers :: 13.10.2012 14:49 :: bigdogguru :: Replies: 7 :: Views: 974
Hi All ,
One question for electronic expertise,
I have pic18f25k22 , which is a great microcontroller, I made small project which is connect to GSM modem and temperature sensor , the project will send me SMS every 20 Minutes, the pic18 will read temperature them send sms using gsm modem , then after that the pic18 will be switch (...)
Microcontrollers :: 16.01.2013 08:53 :: mot1639 :: Replies: 8 :: Views: 198
Hi guys ^_^
I have a problem in pic18F6520 CCP4 compare module.
I work in a project that includes controlling a DC-to-AC inverter using pic18, all I need is a 50Hz signal with 50% duty cycle.
so 50Hz = 20ms, 1st 10ms will be + and last 10ms will be - in order to control the inverter circuit.
I saw Tahmid's code, modified it so it can su
Microcontrollers :: 18.01.2013 09:30 :: Prince Vegeta :: Replies: 7 :: Views: 225
The LCD is displaying time and date along with some symbols in between in a fluctuating manner. Please some one help me to solve the problem.
//#define _XTAL_FREQ 4000000 // 4 MHz clock
#define LCD_EN PORTCbits.RC2
#define LCD_RS POR
Microcontrollers :: 22.01.2013 23:33 :: ARAVINDHANK :: Replies: 6 :: Views: 235
I am new with the PICs and compilers and I have to use it in a part of a project.:| I am using the pic184520 and the MPLAB 8.86 C compiler. Im trying to read txt file and send it by USART
/* Serial Communication Transmit Example */
/* Using Port C as a USART Port */
#pragma config OSC = HS /*set osc mode t
Microcontrollers :: 27.02.2013 10:45 :: cascomio :: Replies: 0 :: Views: 121
I'm working with a pic18 and I want to put this PIC into sleep mode and wake it up every 3 minute. How is that possible?
The WDT can put the PIC into sleep only 2.3 seconds.
The IDE I'm working in is MikroC
Microcontrollers :: 29.07.2013 02:19 :: zuser999 :: Replies: 3 :: Views: 198
for PIC microcontrollers if want to make your RTOS premptive select the pic18 architecture because the Stack is editable.
Hope u follow the thing
Microcontrollers :: 05.12.2004 08:55 :: swapgo :: Replies: 2 :: Views: 1201
Hi, I have built a system to read temperature using the DS1621 and the PIC16F819. This PIC reads the temperature from the DS1621 through I2C and sends the data to the computer through RS-232. I am using the following code for tests (PIN_B1 and PIN_B4 are the ones used for the I2C communication):
I'm using PCM 3.235 version.
Microcontrollers :: 10.12.2006 08:04 :: otavio_fisica :: Replies: 0 :: Views: 1511
Anybody has some documents/links to share how to design preemptive RTOS on pic18?
Or are there any Software that supports Preemptive RTOS (similar to Salvo but this case a preemptive RTOS instead of cooperative).
One high priority task of my applcation (the highest priority task on my applciaiton if running anyway) is to be pe
Microcontrollers :: 17.12.2007 02:25 :: neoaspilet11 :: Replies: 2 :: Views: 717
I'm building a small USB device which will connect into a Windows PC.
This device should have 8 pairs of connectors and its role is to detect which pairs are shorted and send this data to the host PC.
The USB device should repeatedly (on some interval) send a status code to the host PC. For example, if only the first and last pairs a
Microcontrollers :: 08.04.2009 08:23 :: codeguy :: Replies: 3 :: Views: 498
The p18f4550 does not have an option register.
This register is usually used on the mid range devices to set up the timer_0/WDT prescaler and the interrupt enables for the int pin, timer0, port b change and their interrupt flags.
On the pic18, these have their own registers.
Also, never ignore compiler warnings unless you understand (...)
Microcontrollers :: 27.04.2009 12:48 :: btbass :: Replies: 12 :: Views: 2899
there are RESET instruction available in many microcontrollers.u can use that. for ex.. pic18 series has RESET instruction, using that resets program counter and also some registers .but in PIC16 series there is no Software RESET instruction,where u can use GOTO will force the program counter to start from Initial location but it doesn'
Microcontrollers :: 10.06.2009 09:07 :: vijay s :: Replies: 4 :: Views: 764
Hello everyone, I have the following problem:
I have many buttons as an input connected to pin RB0 RB1 RB2 RB3 RB4 RB5 RB6 RB7
and led in pin RD0 RD1
how to change the interrupt state is not detected?
#define PIC_CLK 4000000
__CONFIG(1, HS); //for freq>8Mhz and <20Mhz, use XT instead of HS for <8Mhz
Microcontrollers :: 10.07.2009 15:52 :: narcon :: Replies: 0 :: Views: 930
As well as I Know timer0 never stops In PIC16
but in pic18 you can use TMR0ON to stop or start timer
Microcontrollers :: 30.07.2009 02:10 :: saeed_pk :: Replies: 5 :: Views: 1338
I'm having troubles trying to simulate a simple analog comparator on pic18F4550(or 18F4553) with proteus(already tried versions 7.2 sp6 and 7.5 sp3)
using PIC16F877 the same code works on proteus without a problem.
the relevant code is:
#FUSES NOWDT //No Watch Dog timer
Microcontrollers :: 14.08.2009 01:51 :: stunny :: Replies: 0 :: Views: 1388
I am writing a program on this pic18 that takes measurements, writes to flash, then waits around for 15 minutes (or some other user-defined time period) until it does it again. It is supposed to do this for 2 weeks, so I need to conserve battery.
What's in my mind is to put the PIC in sleep mode, then trigger an interrupt off an internal time
Microcontrollers :: 06.11.2009 21:52 :: robbycon :: Replies: 1 :: Views: 533
Mayyur, in the pic18, you have two vectors pre-defined. The high priority at 0x08 and low priority at 0x18. You can take advantage of that and assign some of the interrupts as high priority and some as low priority.
If you don't want to use that, you can always just 'poll' for the interrupt flag. So, for example, when an interrupt occurs, you c
Microcontrollers :: 06.04.2010 03:55 :: jumper2high :: Replies: 3 :: Views: 1970
i m writing a program in ccs coding using pic16f877a...i m using 3 variables x,y and z..
program runs successfully for x and y..but as soon as i include z in the program..OUT OF RAM appears in says to use the #separate statement..and i don't know how to use it..plz help
here is my program
Microcontrollers :: 01.05.2010 04:49 :: summerof69.kunal :: Replies: 0 :: Views: 953
I'm testing a simple CCS program on ISIS.
I'm using a pic16F877 (20MHZ)
it compiles fine but no PWM is shown in ISIS.
i know the problem is on ISIS because i had a similar prog running fine on hardware.
has anybody managed to show PWM on isis from a 16f877 ?
thanks a lot.
//#include "speed control.h"
Microcontrollers :: 02.10.2010 12:37 :: UnLoCo :: Replies: 1 :: Views: 900
Check out this link. It may help you.
Introduction to pic18's timers - PIC Microcontroller Tutorial | eXtreme Electronics .
Microcontrollers :: 07.10.2010 00:29 :: incomplete_jerin :: Replies: 1 :: Views: 326
#FUSES NOWDT //No Watch Dog timer
#FUSES HS //High speed Osc (> 4mhz)
#FUSES PUT //Power Up timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NODEBUG //No Debug mode for ICD
Professional Hardware and Electronics Design :: 21.01.2011 14:25 :: klystron :: Replies: 14 :: Views: 2255
hi i have some project that i made i hope that help you so
i used just tow 7 degement and i have no problem
i give you here the prog that i manage a controle tempreture and i display it
also with the picture of the circuit
this is the code of th .h file
#FUSES NOWDT //No Watch Dog T
Microcontrollers :: 18.01.2011 10:23 :: MODCHIP :: Replies: 9 :: Views: 2279
If that is the only thing your uC has to do, you may use a delay (otherwise you may use a timer);
First find time to operate one instruction cycle; Tcy (base on your oscillator speed for pic18 it is; 4/(Osc speed) seconds);
Find value; how may instructions should be wasted to achieve delay-time;
Write a code to waste that much of in
Microcontrollers :: 19.01.2011 03:31 :: DineshSL :: Replies: 3 :: Views: 610
I have a project and I can't figure it out why it isn't working the I2C. I need to transfer some data from a PIC16F877A to another using I2C. Here is the code:
#FUSES NOWDT //No Watch Dog timer
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz
Microcontrollers :: 19.01.2011 11:35 :: SNooPI :: Replies: 0 :: Views: 2897
Is it worth trying with the internal osc intead of xtal. Will at least proves ext osc is ok if you still get the same problems. Ok for up to 8 megs
This setup works for me but you will need to change pins/osc settings etc to suit your needs
#use delay(clock=4000000,RESTART_WDT) // RESTART WDT DURING DELAYS////////////
Microcontrollers :: 02.02.2011 04:38 :: GrandAlf :: Replies: 21 :: Views: 1223
I have written an RTOS for the Pic24, 30, 33 16-bit micros and posted it on eda board here.
I don't know if this will be much help for the pic18 micros, but might give you some ideas.
Embedded Systems and Real-Time OS :: 28.03.2011 04:22 :: btbass :: Replies: 15 :: Views: 1720
Hello everybody.I want to write a program using pic18F452&XTAL=20MHZ in C or mikroC to do the followings;
1.Simultaneously turn a timer on to count for 1 sec. and
also count the number of High state of the
2.Turn a timer on for 1 sec. and as soon as a input signal injected
Microcontrollers :: 23.04.2011 15:48 :: bobx :: Replies: 1 :: Views: 1623
Introduction to pic18's timers - PIC Microcontroller Tutorial | eXtreme Electronics
Hobby Circuits and Small Projects Problems :: 12.10.2011 07:47 :: salmanliaquat :: Replies: 3 :: Views: 961
I need to interface a potentiometer with a servo motor via the PWM module of PIC 18F4550 using mikroC. Can it be done? If so, please help me out.
Thanks in advance.
Servo motor needs 50Hz PWM. What I know, PIC16 PWM Module can't generate low frequency at 50Hz. I don't know how pic18.
The option is generate 50Hz si
Microcontrollers :: 24.11.2011 23:25 :: engshahrul :: Replies: 4 :: Views: 860
Im using C18 complier on MPLAB with pic18F.
How do i display an "unsigned int" variable on to the LCD that changes every 1 sec.
Microcontrollers :: 08.12.2011 20:20 :: Neyolight :: Replies: 6 :: Views: 874
As I have told earlier, the MCU which I am currently using is ATMEGA32L
Yes, you have hidden the information in quoted text.
An ATmega has no means to measure time intervals with ns resolution. PIC24 and some pic18 processors have an analog CMTU (charge time measurement unit), that converts time intervals to analog voltages. It
Microcontrollers :: 29.02.2012 03:21 :: FvM :: Replies: 6 :: Views: 273
I'm using pic18 Explorer Board's chip C18 Compiler
Microcontrollers :: 23.03.2012 06:21 :: dotz89 :: Replies: 1 :: Views: 408
Please read the interrupt chapter of the microcontroller datasheet,
maybe you can get a better idea...
An interrupt es an 'event' that happens inside the microcontroller, this 'event' is 'triggered' by internal or external means... (say a edge detected on an special input pin, or a timer overflow, or some communication event)
this 'events' c
Microcontrollers :: 17.04.2012 10:06 :: Kurenai_ryu :: Replies: 7 :: Views: 317
If you want to know from the basic to spi and i2c protocols and interfacing devices like motor, relay, DS1307( timer)
go for the Muhammed Ali mazidi book for pic18.
he start with the assembly and then C language.
I think this is the best book.
He also written book on 8051,AVR and intell etc.
Microcontrollers :: 03.06.2012 01:24 :: arunraj1984 :: Replies: 2 :: Views: 435
am using pic18f458
- - - Updated - - -
thank you so much kripton.
but i want to calculate.
i want to know how it can calculte.
Microcontrollers :: 12.07.2012 23:55 :: kingrosekhan123 :: Replies: 16 :: Views: 954
i'm using pic18F452 for my development. the circuit is resetting during the simulation process.the circuit image is attached here..
thanks in advance.
Microcontrollers :: 12.12.2012 04:07 :: BISH :: Replies: 21 :: Views: 826
I am studying how to use pic18 right now, I have found a good example here in edaboard I am sure I did follow the instructions in here, but I am stuck in "build" process. I can't build the project because MikroC says the error Undeclared
Microcontrollers :: 24.12.2012 20:49 :: eebhoi01 :: Replies: 8 :: Views: 526
Hello coolvasanth07, after seeing your code, I can see several errors. First, and as Tahmid said should be the PIC header but enclosed between the simbols <> That mean that this library is located in the default directory assigned by the compiler, in this case:
If you use "" me
Microcontrollers :: 01.01.2013 09:03 :: bmb_10 :: Replies: 25 :: Views: 3338