Menu

Calculation with large figures

Help
Capaction
2011-07-12
2013-05-30
  • Capaction

    Capaction - 2011-07-12

    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

     
  • Nobody/Anonymous

    Word variables are 16 bits, so max value a word can have is
    65536.
    Gcbasic can only handle a max of word variables.

     
  • Nobody/Anonymous

    Perhaps you can just use thouthads RPM:

    ThRPM = 30000 / Time180Deg

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.