??? 01/06/09 07:56 Modified: 01/06/09 07:58 Read: times |
#161324 - On the EMI/EMC side Responding to: ???'s previous message |
Richard Ries said:
1) Get a copy of "Code Complete" by Steve McConnell, and "Writing Solid Code" by Steve Maguire. Apply their concepts.
2) Define "hang." It will mean different things to different people. 3) Fill all unused code areas with a "safe" value, such as "02 00 00", which is a jump to the reset address. It is "safe" because if the code starts executing at a location with 00, it gets treated as a NOP command. Or if your code is sequential (no gaps between code blocks, just fill the unused areas with 00. 4) Make sure you deal with unexpected input values. Each IF construct should have an ELSE, each SWITCH/CASE should have a DEFAULT. 5) USE COMMENTS! Tell what you are trying to achieve, NOT what the code is doing!! MOV R0,#Buffer ; load R0 MOV A,@R0 ; load acc from R0 ADD A,#30 ; add 30 MOV @R0,A ; Store result is useless! ; convert numbers (0..9) in buffer into ASCII values MOV R0,#Buffer MOV A,@R0 ADD A,#'0' MOV @R0,A tells WHAT is being done, along with the assumption that the buffer has only digits in it. 6) Get a copy of "Code Complete" by Steve McConnell, and "Writing Solid Code" by Steve Maguire. Apply their concepts. --Rich And on the EMC / EMI side buy a house next to Kai , for such a bulletproof system that you want to design :). -Ap |
Topic | Author | Date |
Mcu working for 24x7 | 01/01/70 00:00 | |
:) | 01/01/70 00:00 | |
be careful | 01/01/70 00:00 | |
before testing | 01/01/70 00:00 | |
sayings | 01/01/70 00:00 | |
They dont disclose exactly | 01/01/70 00:00 | |
Mars Rover | 01/01/70 00:00 | |
That wasn't a failure mode! | 01/01/70 00:00 | |
It could too be a failure.... | 01/01/70 00:00 | |
indeed, it could ... but it wasn't! | 01/01/70 00:00 | |
Essential![]() | 01/01/70 00:00 | |
On the code side, | 01/01/70 00:00 | |
Mcu working for 24x7 | 01/01/70 00:00 | |
On the EMI/EMC side | 01/01/70 00:00 |