4
votes
3answers
102 views

five month countdown timer circuit?

I'm a beginner in electronics, so I just have an idea in my head and don't know how to actually make it. I want to make a countdown circuit, for an event in next 5 month. The display format is like ...
3
votes
1answer
60 views

PIC interrupt based soft UART timing trouble

I've tried to implement a software UART on a PIC18F452 using TIMER0 interrupts and I can't get the timing working. I'm using MPLAB ASM for compilation and the PICkit2 for programming. ...
0
votes
1answer
55 views

PIC24H delta time calculation

Hello I'm making a project for my intro embedded software class and I need to make use of a timer in a program. If I'm not mistaken this code should be looping the while for at least 500 ...
2
votes
1answer
80 views

PIC18 - problems getting inline assembler routine to work

(EDIT: Added C18 disassembly code) I need to optimize a function written in C for a PIC18f4585. I am using C18 to compile. The function I am trying to re-write in assembly is: ...
2
votes
3answers
234 views

Reading from multiple sensors and synchronizing data

I am working on a project which requires reading from four sensors simultaneously with time stamps down to millisecond. Right now the best I can come up with is to use four PICs to read from each ...
1
vote
1answer
39 views

DSPIC30f timer1 not trigger everytime on POR

I am using timer1 on DSPIC30f4011 to generate an interrupt every one millisecond. However, the timer1 ISR is not executed every time on POR (2 out of 10 times). If I turn on the power for the chip and ...
0
votes
1answer
118 views

How to show PIC cycles in MPLAB when using PICKit?

The MPLAB SIM has a nice stopwatch that shows the cycle count. But when using a PICKit 3, the stopwatch is not there. Any suggestions on how to bring this function back?
0
votes
2answers
163 views

PIC: Watchdog timer off by a factor of 4

I have a PIC16 (datasheet here) for which I use the watchdog timer. I configure the watchdog timer as follows: WDTCONbits.WDTPS = 0b01110; According to page 105 ...
2
votes
6answers
364 views

Precise timing with a PIC18 microcontroller?

I'm trying to write a software serial implementation and am having trouble with timing. I'm using Timer0 on a PIC18F242 and for some reason it does not seem to be very accurate. I've been trying to ...
6
votes
1answer
457 views

Using Timer0 overflow to gate Timer1 on PIC12F1822

I am trying to use TMR1 to count TMR0 overflows. To do this I am using TMR1 with gate ...
2
votes
1answer
2k views

C18 Timer0 timing calculation using MCC18

I am programming a PIC18F4520 and I've set it to use a 32Mhz internal clock. I need a counter to tick every second so I'm using TMR0 for this purpose. To use ...
3
votes
1answer
164 views

Is using a shorter timer period less accurate than using a longer one?

I'm using a dsPIC 33FJ128GP804 and I'm trying to record data at 200 Hz as accurately as possible. My device also has a GPS and I'm noticing that my timer is drifting compared to the GPS by about 333 ...
3
votes
2answers
2k views

How to configure the internal oscillator in a PIC16F616?

I want to use the internal oscillator in PIC16F616 in 8 MHz configuration and have the I/O function on RA4 and RA5. I've read ...
1
vote
1answer
440 views

Timer1 not running on PIC16F628

I have this little project that requires exact clock so I'm using 32768 Hz quartz on RB6 & RB7 on my PIC16F628. Both pins are grounded using 33 pF capacitors. My code that configures the timer1 ...
0
votes
2answers
684 views

PIC Microcontroller timer

We want to be able to design a PIC microcontroller based timer. The specification requires that we have a time for at least one month (30 days). I have been trying to figure out how one can do that ...
4
votes
4answers
785 views

Maximum attainable delay with Micro controller

I am designing a microcontroller based delay circuit to implement delays of 2 hours, 1 hour, 45 minutes, and 30 minutes. The circuit will automatically turn on off a relay after this time period has ...
0
votes
1answer
112 views

what is the default internal clock for pic16f1946?

While going through the data sheet, section 5.3.1 says: "Default system oscillator determined by FOSC bits in Configuration Word 1". How can find the value of this default clock, is it 8MHz or 31khz? ...
1
vote
1answer
323 views

I having troubling understand what other interrupt firing besides TMR2 on PIC18f4550

I having troubling understand what other interrupt firing high_isr besides TMR2 on PIC18f4550. Way I detect it I set pin MY_DBG_PIN toggling everytime high_isr is activated, and from what I try to ...
1
vote
1answer
288 views

Writing to timer counter while timer is running

I'm using PIC16F1947 for a project. The project requires real time tracking so a stable 32768 Hz crystal is connected with the Timer1 oscillator. The Timer1 oscillator circuit and the crystal will ...
2
votes
1answer
691 views

Increasing the delay using 'option' register in Pic16f877a

I have learned that the maximum 'delay' possible in pic16f877a running with a source of 11.0592MHz (11059200 / 4 actually) is 23 ms.. without using software delays (delay_ms( )).. the calculation was ...
6
votes
4answers
1k views

Reading a 16-bit timer on an 8-bit MCU

Since an 8-bit MCU can't read the whole 16-bit timer in one cycle, this creates a race condition where the low-word can roll over between reads. Does the community have a preferred method of avoiding ...