??? 04/28/04 07:56 Read: times |
#69370 - RE: set TMOD in timers Responding to: ???'s previous message |
hi,
first of all, I beg yours pardon for that my post has been starting such posting war. I think I should explain my post and stop it all. Well, in my example I showed original poster about how to set/reset any bit of either SFR or memory location; just and only it. I did not teach him how to "good program". It was an example in case he does not know WHY and/orl commands are used. Now there is another question: WHAT IS IT FOR. And at this point Erik`s example is very good. Like him I use the same way exactly: my custom created header file which all my definitions are included in. And I never use "magic numbers" when manipulate with bits and values of SFRs/variables; I preffer for "magic words" instead (= Another claim was said to Erik: for such example you posted, it should be explained what SF_TMOD and SM_TMOD_T1TM1 mean. By other words it would be enough to put two lines before that example, something like: SF_TMOD EQU TMOD SM_TMOD_T1TM1 EQU 00010000b btw, Erik: your example is correct if TMOD contains 0000xxxx only. For example, if timer 1 was configured to mode 2 (0010xxxx) and then must be reconfigured to mode 1 so your example does not do it but sets mode 3 (halt timer 1) instead. Anyway, it is another story. So I think all is good and there is nothing for flame. Both Erik`s example and mine are correct and useful; they just explain different points. Regards, Oleg |
Topic | Author | Date |
set TMOD in timers | 01/01/70 00:00 | |
RE: set TMOD in timers | 01/01/70 00:00 | |
RE: set TMOD in timers | 01/01/70 00:00 | |
RE: set TMOD in timers | 01/01/70 00:00 | |
RE: set TMOD in timers | 01/01/70 00:00 | |
RE: set TMOD in timers | 01/01/70 00:00 | |
RE: set TMOD in timers | 01/01/70 00:00 | |
RE: set TMOD in timers | 01/01/70 00:00 | |
RE: set TMOD in timers | 01/01/70 00:00 | |
RE: set TMOD in timers | 01/01/70 00:00 | |
RE: set TMOD in timers | 01/01/70 00:00 | |
RE: set TMOD in timers | 01/01/70 00:00 | |
RE: set TMOD in timers | 01/01/70 00:00 | |
it grew REALLY useful for Cygnal F12x![]() | 01/01/70 00:00 | |
RE: set TMOD in timers | 01/01/70 00:00 |