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: 2128
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: 2979
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: 4730
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: 5181
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: 724
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: 1651
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: 895
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: 1777
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: 860
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: 1175
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: 551
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: 1796
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: 274
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: 300
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: 395
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: 262
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: 331
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: 1328
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: 1659
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: 817
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: 591
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: 3413
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: 845
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: 1065
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: 1569
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: 1588
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: 643
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: 2163
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: 1145
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: 1048
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: 384
#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: 2547
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: 2864
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: 767
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: 3845
now I'm working with a automotive project. whixh uses a pic18F8520. but i have som hardware issues.
1.when i switch on the device it will not start until i removed the power jack and reconnect it( I am sure that there is no loose connection something. i'm using a 1117 3.3 v regulator for PIC)
2.When the device was works
Microcontrollers :: 24.01.2011 06:07 :: sreepss :: Replies: 21 :: Views: 1526
Hello and AoA every1
Kamal here, can anyone please guide me about the development of an RTOS?
i have to design an RTOS as part of my FYP, and i have read number of books about RTOSes and i know lots of basics about RTOSes but the problem is the development which unfortunately i cant do and i'm unable to get/find any help about that.....i know R
Embedded Systems and Real-Time OS :: 27.03.2011 17:47 :: bukhari917 :: Replies: 15 :: Views: 1917
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: 2198
can u help me with the embedded C code...i m using a pic18 microcontroller need a timer of 100msec..
Hobby Circuits and Small Projects Problems :: 12.10.2011 07:16 :: chintanvasa :: Replies: 3 :: Views: 1089
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: 1114
Both. Im stuck with both problems
This is my function to display number. You can display in any order like decimal, hexadecimal or binary. You can convert this into pic18.
void lcd_number(unsigned int no, char base, char digit)
Microcontrollers :: 09.12.2011 05:50 :: engshahrul :: Replies: 6 :: Views: 1074
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: 353
I'm using pic18 Explorer Board's chip C18 Compiler
Microcontrollers :: 23.03.2012 06:21 :: dotz89 :: Replies: 1 :: Views: 525
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: 427
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: 571
its gud to know ur problem is solved.
can you programm with ccs c compiler?.....i'll appreciate it if you can write your code with ccs.
thanks all....problem solved...
the problem is that : i have to select hitech universal tool suit with hitech c pic18 compiler
Microcontrollers :: 12.12.2012 10:20 :: bioda :: Replies: 21 :: Views: 1273
yes I have same problem usb1 project from advanced PIC Microcontroller projects in c with pic18f
Undeclared Identifier 'USB_Interrupt_Proc'
Microcontrollers :: 08.09.2013 00:25 :: nyanphyoaung :: Replies: 8 :: Views: 1112
Permit me to join in the discussion.i compiled your code;
#include "C:\Users\xyz1\Desktop\xyz_new\lab tutorial.h"
#FUSES NOWDT //No Watch Dog timer
#FUSES HS //High speed Osc(>4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP /
Microcontrollers :: 02.01.2013 13:48 :: bioda :: Replies: 25 :: Views: 5841