PDA

View Full Version : PIC 18F device suggestion.



srspinho
- 2nd July 2015, 16:11
Hello Guys !

I have an old non-commercial project running on a 16F877 @ 4mhz and a 4x20 lcd.

The project is based on Darrel's interrupts libraries, with the following configuration :

TMR0 as a pulse counter, to calcualte the car´s speed
TMR1 as CCP1 to calculate the fuel consumption
TMR2 as a 500 ms time base.

This arrangement is working good, but I would like to improve it and use the Richard's ST7735 display Lib for a better presentation and, also, read the RPM form the car. So, I think I'd need another Timer/Counter.

I´m planning to keep using the Darrel's interrupts libraries (18F version).

I have some PIC18LF2420 here with me and I was reading its Datasheet.

In the Datasheet's Timers section, they say that TMR3 can not be used as an independent counter, because TMR1 and TMR3 share the same pin T13CKI for their external input.

So, should I search for another device with more timers if I need to read the Car's RPM ?

If yes, is there a suggestion for a new device I should consider ?

Thank you very much.

Sérgio.

aratti
- 2nd July 2015, 20:08
Why not using a frequency to voltage converter and than use an ADC channel to read the car RPM.

Cheers

Al.

srspinho
- 3rd July 2015, 02:49
Hi !

Hummmm... Can you Belive I Had never tryed This before !

I will make some research on converting frequency to voltage on a range from 0v to 5v.

Thank you for the advice !

towlerg
- 4th July 2015, 01:28
16f1526/7 has a whole bunch of timers.

Exactly how are the three timers on the 877 used? perhaps you can shuffle them and make it work with just software. I assume existing timer3 doesn't need a trigger input. Maybe 1 or 3 on the 2420 could be used as the timebase.

George

srspinho
- 6th July 2015, 13:28
Hi George,

thank you for the reply !

Well, I´m using all 16f877's as described bellow :

1) TMR0 => Count the number of pulses from the car's wheel.
2) TMR1/CCP1 => measure the Feel Injector's "On-Time"
3) TMR2 => This timer is used as a 500ms time base for all calculation and display update.

I´m using DT Interrupts to deal with the timers.

May be use the RB change pin interrup to count the RPM events.

I´m planning to move my project to the ST7735 display, and use the Richard libs available here in the forum. SO, I should move to a 18F series Pic.

I have here with me, some 18F2420, 18F4550 and 18F2520. I'll try to some of them.

My best regards !

Sérgio