![]() Movf STATUS,w move status register into W register Movwf w_temp save off current W register contents Status_temp EQU 0x71 variable used for context savingĬount1 EQU 0X20 First Counter for DelayĬount1v EQU 0X21 Count Storage for Refill DelayĮEPROM_ADDR Equ 0x00 Address of EEPROM byte used W_temp EQU 0x70 variable used for context saving See respective data sheet for additional information on configuration word. The lables following the directive are located in the respective. '_CONFIG' directive is used to embed configuration data within. ![]() _CONFIG _CP_OFF & _WDT_OFF & _BODEN_ON & _PWRTE_ON & _INTRC_OSC_NOCLKOUT & _MCLRE_OFF & _LVP_OFF #include processor specific variable definitions List p=16f628A list directive to define processor ![]() I thought about leaving putting the value in code, but I would like to be able to change that value without having to recompile and reprogram the PIC with a new HEX file if I ever change HOD cells and require a different refill time to sufficiently fill the cell to above the Upper Water Level Sensor. I'm already thinking of what code to write for the subroutine to set the value to the W Register, but what Registers would be used in the onboard EEPROM and what commands would be used to read and write to the EEPROM registers? When the switch to increment the W register goes low it would write the W register to the EEPROM. I would probably read a switch that tells on an input that would tell my pic to read the other input that would increment the W Register to the desired delay. ![]() I was thinking of using an EEPROM to store that data that would be read and moved to the delay counter that is used when the Refill section of my code is running. I got to thinking about how Hydrogen on Demand will be unique, and I need a way to saving a value of how long a delay should be between the time the lower sensor goes low and how long after the upper sensor goes high to keep from overfilling the cell with electrolyte. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |