Can we do this with PS 1/1 ie Timer beat = 1us on PIC16F628 4MHz A hall sensor measures the time for 180°
DIM RPM as word DIM Time180Deg as word
RPM = 60000000 / ( 2 * Time1800Deg )
or
RPM = 30000000 / Time180Deg
GCBASIC compile with code error 0 and no warning
Word variables are 16 bits, so max value a word can have is 65536. Gcbasic can only handle a max of word variables.
Perhaps you can just use thouthads RPM:
ThRPM = 30000 / Time180Deg
Log in to post a comment.
Can we do this with PS 1/1 ie Timer beat = 1us on PIC16F628 4MHz
A hall sensor measures the time for 180°
DIM RPM as word
DIM Time180Deg as word
RPM = 60000000 / ( 2 * Time1800Deg )
or
RPM = 30000000 / Time180Deg
GCBASIC compile with code error 0 and no warning
Word variables are 16 bits, so max value a word can have is
65536.
Gcbasic can only handle a max of word variables.
Perhaps you can just use thouthads RPM:
ThRPM = 30000 / Time180Deg