First, I would like to say thanks to Sam for sending me the code and the schematic.
Second, I have a question: what is the maximum RPM this circuit/code can read?
Thanks!
Daniel.
First, I would like to say thanks to Sam for sending me the code and the schematic.
Second, I have a question: what is the maximum RPM this circuit/code can read?
Thanks!
Daniel.
Hi Daniel,
I added this line:
to keep the display from rolling over 9999. What use do you have for this tach? I do not think I would try it on a turbine, as it updates too slowly, but it was written for a lathe. It will go over 9999 without that line, the max is unexplored. Perhaps someone who is skilled at math could tell you. The displays can be cascaded, if you feel adventurous.Code:if displays > 9999 then displays = 9999
Last edited by Archangel; - 13th March 2009 at 01:46.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
I try to use code from post #1 to my thermometer with 16F628A, DS18B20 and LED display ( like in : http://melabs.com/resources/articles/ledart.htm fig.6). To another topic, I receive one working code, from one user (thanks !).
But, I am still disappointed, because MY code don't work. Please, what's wrong with him ? Thank you !
Code:@ DEVICE pic16F628A, intOSC_osc_noclkout, WDT_OFF, PWRT_ON, MCLR_OFF, LVP_OFF, CPD_OFF, PROTECT_OFF TRISA= %11110000 ' RA0..3=Outputs RA4=Input TRISB= %00000000 ' RB0..RB7=Outputs CMCON=7 ' Disable comparators DQ VAR PORTA.4 DS18B20_12bit CON %01111111 ' 750ms, 0.0625°C I VAR BYTE SIGN VAR BIT TEMPERATURE VAR WORD ; TEMPERATURE REGISTER n var byte segments var portb digits var porta value var word MAINloop : OWOUT DQ ,1,[$CC,$44] WaitLoop: While not DQ Wend OWOUT DQ ,1,[$CC,$BE] OWIN DQ ,2,[TEMPERATURE.LOWBYTE , TEMPERATURE.HIGHBYTE] IF TEMPERATURE.15 = 1 THEN TEMPERATURE = (65535 - TEMPERATURE) + 1 SIGN = 1 ELSE SIGN = 0 ENDIF value = (TEMPERATURE * 10)/16 gosub display goto mainloop ' Subroutine to send the number (0 - 9999) in Value to LEDs display: For i = 0 To 3 ' Loop through 4 digits n = value Dig i ' Get digit to display GoSub display1 ' Display the digit ' Leave it on 2 millisecondS Next i ' Do next digit Return ' Surboutine to display one digit on LED ' i = digit number ' n = number to display display1: 'Digits = $ff ' All digits off to prevent ghosting ' Convert binary number in n to segments for LED Lookup n, [$40, $79, $24, $30, $19, $12, $02, $78, $00, $18,$7f], Segments ' logic low complements ' Set digit pin i to 0 (on) and the rest of the pins to 1 (off) Digits = ~Dcd i Pause 1 'Increase to make digits brighter and flicker worse Return end
Hi, Fratello
One thing is obvious ...
The " Waitloop " , for sure, can't be used whith multiplexed LED's ...
One thing is surprising ...
Do you think your temp calculation is compatible with the provided Led Display ???
One thing is really hazardous ...
While dealing with the display ... you write over your PortA inputs as well as outputs !
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
One, two, three things are for sure : I am a sucker !
It's not the first time when "the language barrier" make me problem...I'm really sorry if I borried somebody.
In the link that I posted it's the schematic (with reference to PBP code) I tried to make...It's sure that I must careful read (and understand !). Thank You verry much for attention and reply ! All the best !
Bookmarks