home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.energy.homepower      Electrical part of living of the grid      2,576 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 921 of 2,576   
   Curbie to muratlanne@gmail.com   
   Re: 1kW $50 E-Cat ? (1/2)   
   30 Jan 12 11:47:10   
   
   From: jim.richards65@yahoo.com   
      
   Jim,   
      
   If the required response time is < 1ms, just poll (no interrupt), the   
   real issue is whether the commands must run in a particular order, in   
   which case you'll need a run-queue, if not just use a command and   
   response loop like below.   
      
   Also, if your timed events are not more than ~50 days apart, the   
   milliSec() function below handles timing register restarts.   
      
   If you need, LCD displays, buttons, or DS1820 perature sensors, let me   
   know, I have software for all that.   
      
   Curbie   
      
   /* This is the command and response loop that drives the controller   
   operation which runs over and over   
       again as long as the Arduino has power. This loop checks command   
   flags set and cleared by the   
       software and runs responses to the set commands while skipping   
   responses for commands not set.   
      
       The most important command which always must be checked no matter   
   what else the controller is doing,   
       is the scram command that insures that the still is not   
   over-heating and shuts the still down and   
       cools it, if it is.   
      
       This loop also sets, checks, and coordinates timing for time   
   sensitive hardware like buttons, LCD   
       display, and temperature sensors. */   
   void loop() {                                       // the loop()   
   method   
   int button;                                         // temporary   
   button value   
      
   button = getButton();                               // get value of   
   button currently being pressed   
   if ( button != BV_NONE ) lastButton = button;       // if button   
   pressed, save its value   
   readTemperatureSensors();                           // if all   
   temperature sensors are not found, isolate failed sensor   
      
   if ( menuCmd ) menuRes();                           // if check for   
   menu button pressed command, run response   
   if ( selectCmd ) selectRes();                       // if check for   
   select button pressed command, run response   
   if ( upCmd ) upRes();                               // if check for up   
   button pressed command, run response   
   if ( downCmd ) downRes();                           // if check for   
   down button pressed command, run response   
   if ( rightCmd ) rightRes();                         // if check for   
   right button pressed command, run response   
   if ( leftCmd ) leftRes();                           // if check for   
   left button pressed command, run response   
   if ( fillCmd ) fillRes();                           // if check for   
   end of fill water phase command, run response   
   if ( purgeCmd ) purgeRes();                         // if check for   
   end of purge air phase command, run response   
   if ( startCmd ) startRes();                         // if check for   
   end of starting phase command, run response   
   if ( adjustCmd ) adjustRes();                       // if check for   
   end of adjust reflux phase command, run response   
   if ( scramCmd ) scramRes();                         // if check for   
   scram phase command, run response   
   if ( scramStopCmd ) scramStopRes();                 // if check for   
   end of scram stop phase command, run response   
   if ( scramTimeCmd ) scramTimeRes();                 // if check for   
   end of scram stop phase command, run response   
   if ( coolCmd ) coolRes();                           // if check for   
   end of cooling phase command, run response   
   if ( alertCmd ) alertRes();                         // if check for   
   end of alert command, run response   
   if ( ddCmd ) ddRes();                               // if display   
   dashboard command, run response   
   }                                                   // end loop   
   function   
      
   unsigned long milliSec(unsigned long startTime) {   // return elapsed   
   time from the given "startTime" in mlliseconds   
   unsigned long timeInterval;                         // time between   
   last read and now   
   unsigned long curTime;                              // current time   
   const unsigned long MAX_TIME = 0xFFFFFFFF;          // full 32 bit   
   value for correcting timer restart (timer value restarts happen every   
   ~50 days of continous use)   
      
   curTime = millis();                                 // get current   
   time   
      
   if (curTime < startTime) {                          // if timer   
   restart has occurred, account for the restart   
     timeInterval = curTime + (MAX_TIME - startTime) + 1L; }   
   else {                                              // if timer   
   restart has NOT occurred   
     timeInterval = curTime - startTime;               // calculate   
   interval from last time temperature sensors read   
   }                                                   // end if timer   
   restart has occurred, account for the restart   
   return timeInterval;                                // return to   
   caller the number of milliseconds elapsed time from the given   
   "startTime"   
   }                                                   // end MilliSec   
   function   
   On Mon, 30 Jan 2012 08:26:50 -0500, "Jim Wilkins"   
    wrote:   
      
   >   
   >"Morris Dovey"  wrote in message   
   >news:jg56ta$bkv$1@speranza.aioe.org...   
   >> On 1/29/12 4:09 PM, Jim Wilkins wrote:   
   >>> ...   
   >> I've finally got the code finished that allows my cheap little uC to do a   
   >> "poor man's version" of multiprogramming and multi-tasking, meaning that   
   >> it can now be doing a whole bunch of essentially unrelated things all at   
   >> the same time. That should make the rest of the development easier and   
   >> faster, and should make the whole thing safer.   
   >>   
   >> Hydrogen leak testing? I thought I'd just use a match.  :o)   
   >> Morris Dovey   
   >   
   >I recently bought an Arduino Uno to play with and am kind of impressed with   
   >the ATmega328's capabilities, and the straight-forward simplicity of the IDE   
   >compared to a PIC.   
   >   
   >I haven't had to take a project's code beyond a single large DO LOOP that   
   >polls rather than waiting for input, even from the keyboard (which does have   
   >its own buffer). Being completely deterministic they are easy to build up   
   >sequentially from dummy code, and to debug, but not ideal for real-time   
   >multitasking, though that didn't matter on a multi-GHz PC running   
   >low-overhead DOS7.   
   >   
   >How did you implement yours, interrupts, time slices, ???   
   >   
   >On big projects I designed a custom ASIC or FPGA to manage time-critical   
   >tasks in hardware, so the main DSP's program only had to send commands and   
   >receive results.   
   >http://www.xilinx.com/   
   >A very nice toy, if you can get the USAF to fund it for you.   
   >   
   >Hydrogen flames are colorless and nearly to completely invisible, depending   
   >on the room lighting. I don't know if the do-it-yourself fabrication   
   >techniques of vacuum apparatus such as knife-edge seals and soft metal   
   >gasket washers would hold up at high pressure and temperature. So far Google   
   >hasn't brought up any useful info on the construction of experimental   
   >pressure vessels and the devices I've made held only hydraulic fluid.   
   >   
   >jsw   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca