I have built two of these and they both work as described in the article with a newly programmed PIC, except:
1. The “Set Trigger On” parameters “Rising” and “Falling” given in the article are invalid and should be “Rise” and “Fall”.
2. The “Set On Time” parameter “Max” does not work as described. Instead the relay is energised for as long as the trigger condition is maintained and the "Set On Time" <Time> value is ignored. So if the trigger condition is set to "Rise" then while the trigger is held high the relay will stay energised, and will only release when the trigger goes low and not at the end of the value set for <Time>.
I subsequently found a more serious problem, which again affects both units I’ve built:
3. If you change the “Set Trigger On” parameter and "Save" the amended configuration and then power off, when you switch back on the timer will not trigger correctly. The problem seems to be with the state of the PIC trigger input, pin 8. Regardless of whether the trigger input is high or low pin 8 stays low. It must be being driven low by the program; in this condition the "Show Status" command states the input is high (because of the inversion by Q1) regardless of its actual state.
You can still alter the on & off times with the "Set On Time" and "Set Off Time" commands but the "Set Trigger On" command has no effect and will not correct the fault. The only way I've been able to cure it is to re-program the PIC I've tried the files downloaded from both the PE website and Silicon Chip website without any difference. I always erase, program & verify to avoid any problems and have dried different PICs and programmers with no success.
As the units work correctly when first programmed I am confident this is a coding problem rather than a hardware fault.
A further test showed just performing the “Save” command without altering any other parameter results in this error on power down/up. This indicates the “Save” command is corrupting the code in some way.
I have read the contents of a newly-programmed PIC both before and after performing the “Save” command (with nothing else altered) and compared the two hex files using the WinMerge utility. The resulting html report shows the files are identical except for lines 103F8 to 103FF, shown below:
:103F600060080800E1005B30E00161020318BE2F29 :103F600060080800E1005B30E00161020318BE2F29
:103F700041306102031CBE2FE001E00A600C080022 :103F700041306102031CBE2FE001E00A600C080022
:103F800000000000000000003200000000000000FF :103F8000003400340034003432340034003400345F
:103F9000E800030000000000E8000300000000004B :103F9000E834033400340034E834033400340034AB
:103FA000FF00FF00FF00FF00010000000000000014 :103FA000FF34FF34FF34FF34013400340034003474
:103FB000E8000300000000006000EA0000000000CC :103FB000E8340334003400346034EA34003400342C
:103FC00003000000000000000000000000000000EE :103FC000033400340034003400340034003400344E
:103FD0006000EA0000000000010000000000000096 :103FD0006034EA34003400340134003400340034F6
:103FE00023000E0022000E0023000E0021000E0010 :103FE00023000E1122000E1623000E1021000E10C9
:103FF0008E008C000800FF00FF00FF00FF00FF00A4 :103FF0008E128C120800FF3FFF3FFF3FFF3FFF3F45
:020000040001F9 :020000040001F9
:04000E00AC0FCF3F25 :04000E00AC0FCF3F25
:08000000FF3FFF3FFF3FFF3F00 :08000000FF3FFF3FFF3FFF3F00
:00000001FF :00000001FF
It’s beyond my expertise to interpret this but it may help someone who’s better at coding.
I reported these to PE’s editor over a year ago and believe he’s passed them on to Silicon Chip but there’s been no response.
Has anyone any ideas? Has anyone got this project working successfully after saving changes?
1. The “Set Trigger On” parameters “Rising” and “Falling” given in the article are invalid and should be “Rise” and “Fall”.
2. The “Set On Time” parameter “Max” does not work as described. Instead the relay is energised for as long as the trigger condition is maintained and the "Set On Time" <Time> value is ignored. So if the trigger condition is set to "Rise" then while the trigger is held high the relay will stay energised, and will only release when the trigger goes low and not at the end of the value set for <Time>.
I subsequently found a more serious problem, which again affects both units I’ve built:
3. If you change the “Set Trigger On” parameter and "Save" the amended configuration and then power off, when you switch back on the timer will not trigger correctly. The problem seems to be with the state of the PIC trigger input, pin 8. Regardless of whether the trigger input is high or low pin 8 stays low. It must be being driven low by the program; in this condition the "Show Status" command states the input is high (because of the inversion by Q1) regardless of its actual state.
You can still alter the on & off times with the "Set On Time" and "Set Off Time" commands but the "Set Trigger On" command has no effect and will not correct the fault. The only way I've been able to cure it is to re-program the PIC I've tried the files downloaded from both the PE website and Silicon Chip website without any difference. I always erase, program & verify to avoid any problems and have dried different PICs and programmers with no success.
As the units work correctly when first programmed I am confident this is a coding problem rather than a hardware fault.
A further test showed just performing the “Save” command without altering any other parameter results in this error on power down/up. This indicates the “Save” command is corrupting the code in some way.
I have read the contents of a newly-programmed PIC both before and after performing the “Save” command (with nothing else altered) and compared the two hex files using the WinMerge utility. The resulting html report shows the files are identical except for lines 103F8 to 103FF, shown below:
:103F600060080800E1005B30E00161020318BE2F29 :103F600060080800E1005B30E00161020318BE2F29
:103F700041306102031CBE2FE001E00A600C080022 :103F700041306102031CBE2FE001E00A600C080022
:103F800000000000000000003200000000000000FF :103F8000003400340034003432340034003400345F
:103F9000E800030000000000E8000300000000004B :103F9000E834033400340034E834033400340034AB
:103FA000FF00FF00FF00FF00010000000000000014 :103FA000FF34FF34FF34FF34013400340034003474
:103FB000E8000300000000006000EA0000000000CC :103FB000E8340334003400346034EA34003400342C
:103FC00003000000000000000000000000000000EE :103FC000033400340034003400340034003400344E
:103FD0006000EA0000000000010000000000000096 :103FD0006034EA34003400340134003400340034F6
:103FE00023000E0022000E0023000E0021000E0010 :103FE00023000E1122000E1623000E1021000E10C9
:103FF0008E008C000800FF00FF00FF00FF00FF00A4 :103FF0008E128C120800FF3FFF3FFF3FFF3FFF3F45
:020000040001F9 :020000040001F9
:04000E00AC0FCF3F25 :04000E00AC0FCF3F25
:08000000FF3FFF3FFF3FFF3F00 :08000000FF3FFF3FFF3FFF3F00
:00000001FF :00000001FF
It’s beyond my expertise to interpret this but it may help someone who’s better at coding.
I reported these to PE’s editor over a year ago and believe he’s passed them on to Silicon Chip but there’s been no response.
Has anyone any ideas? Has anyone got this project working successfully after saving changes?