Amiga.org
Amiga computer related discussion => Amiga Hardware Issues and discussion => Topic started by: amiga4001 on August 05, 2007, 06:29:08 PM
-
I purchased an electronic revcounter for my car.
It needs to be readjusted so it will show the correct rpm.
It works by taking an impulse from the distributor.
Every impulse represents a certain amount off rpm.
I was thinking about some kind off relay powered by either an amiga500 or a commodore 64.
This way I can set the pulses and see what the gauge reads.
But where to find a schematic for a relaycard?
Nothing fancy just one relay will do nicely.
-
The only adjustment you should need with a rev counter is the number of to set the number of cylinders in your engine, ie the number of pulses per revolution of the engine.
-
Well this rev counter has a adjustment which you can set to meet the resistance in the revcounter.
That is connections,aging electricalparts in the counter and the resistance off the moving parts inside.
I now have a working setuo with my C64 to power the gauge.
First time in basic:
10 poke 56579,1 to initialize the gate I believe.
20 poke 56577,0
30 poke 56577,1
40 a=a+a;?a
50 goto 20
This way I gat maximum off 600 rev/min on the revcounter.
Basic seems to slow...for nice adjustment.
So in assembler?:
c000 lda #$01
c002 sta $dd03
c005 lda#$00
c007 sta $dd01
c00a jsr $c020
c00d lda #$01
c00f sta $dd01
c012 jsr $c020
c015 jmp$c005
c020 ldx #$00
c022 inx
c023 bne $c022
c025 rts
With this I get about 4500 rev/min on my gauge very usable but I need to know the pulses the c64 gives to set the gauge.
So a a=a+1 and a print a in assembler???
-
Based on your BASIC program (and provided that I read it right) I would guess the assembler version should go something like this (saving a few cycles here and there):
ldx #1
ldy #0
sty $80 ; our "a", just a random spot in the ZP
stx $dd03
loop:
sty $dd01
stx $dd01
inc $80
jmp loop
This would naturally loop forever and won't do much as-is. You also need a timer and a print function. Let me know if you need more help and I'll be glad to assist.
-
I take it you aren't going drag racing with a tachometer like that!? :-)
-
Dragracing?That is an idea!
No it is for an oldtimer a triumph gt6 mk1.
I can let a company do the adjusting but there is no fun in there and I want to learn some assembler on the C64 just for the fun.
On one side it is very simple and on the other...
The program skurk provided doesn't wan't to work gauge only moves a tiny bit.
Maybe beacuse i replaced the loop with a jmp command?
Or it is going to fast for the gauge or the fet which is powering the gauge.
Still I have no working program to drive my gauge and measure the pulses.
Is there no simple way to count an amount off loops?
And why does loop: don't work in the monitor off the powercartridge?
It's used in all C64 tutorials on machinelanguage.