TheRegnirps

Member Since: January 8, 2009

Country: United States

Profile

Bio

Purveyor of fine ARM products and various very cool things.

Role

CTO

Organizations

Sigma Pi Sigma

Spoken Languages

English, Mandarin

Programming Languages

Forth, C, Assembler(65C02, 68HC11, PPC, ARM)

Expertise

Godlike

Interests

Embedded instrumentation. Detection of the weakest of signals of all sorts. Synthetic aperture RADAR/SONAR and interferometric radio astronomy. Algorithms for multi-beam and spotlight. Inventor of the Rotating Graviometer.

Websites

www.regnirps.com www.andahamer.com

Publications

I share not with mere Earthlings!

  • We have come a long way from demonstrating a switch with a battery and light bulb! I think your demo took over a billion transistors.

  • It is Amazon style as far as the vertical layout and finding reviews. Amazon puts a lot of resources behind finding the best way to generate sales so why not copy them?

  • I thought it fit the hysteresis version.

  • Yes, give it a try. I can think of reasons it will be faster and reasons it will be slower :-) Smaller, I’m pretty sure about.

    The other code does 1, 2, or 3 IF’s, and the inner IF’s test a math result, so this just might be faster on the average as well.

  • I looked at the problem a bit, and with some assumptions about the overall code, I think this will do it.

     if( abs( input-currentValue) > hysteresis){
         newData = 1;
         currentValue = input;
     }
    
  • I’m missing something I guess. In the snippet, newData is set in all four cases, and they all fall though if there has been no change. Hmmm. Are you saying this detects changes as it executes? Not like a case statement, but dependent on the order of the IF statements, which execute based on the update that may have happened in the previous if statement? I think I see.

  • if( input != currentValue){ //Skip if value has not changed 
        if( hystState==0 && input < currentValue - hysteresis ) hystState = 1;
        if( hystState==1 && input > currentValue + hysteresis ) hystState = 0; 
        NewData=1 
    } 
    currentValue = input; //Always update
    
  • I don’t know the expectation for the code, but I think this does it with a smaller footprint and maybe more clear logically.

    if( input != currentValue){  //Skip if value has not changed
        if( hystState==0 && input <  currentValue - hysteresis ) hystState = 1;          
        if( hystState==1 && input >  currentValue + hysteresis ) hystState = 0;
        NewData=1
    }
    currentValue = input;  //Always update 
    
  • //—Hysteresis10BitKnob——————————————————–

    if(hystState == 0){ 
    
        if( input < currentValue - hysteresis ) hystState = 1;          
        if( input > currentValue + hysteresis ) hystState = 0;
    
        currentValue = input;
        NewData=1
    }
    
  • So, you get your plant built and running, sell things for 3 or 4 years then lay everybody off and shut down? How to you build another plant? How do you do the standard thing of selling the foreign rights when you are going to be copied at home in a couple years? In fact, why would anyone buy from you when cheaper versions will be here in a just a couple years?

No public wish lists :(