??? 12/07/04 08:19 Read: times |
#82686 - is it C-language? Responding to: ???'s previous message |
it seems you use C-language,
but why, why, why, do you manipulate with registers directly from C-language??? Lines like next: DPH = u_add; DPL = l_add; ACC = DPL; SPDR = ACC;have no mean in the whole!!! Compiler and optimizer use the all registers by own way and even you wrote DPL = l_add; //... ACC = DPL;it DOES NEVER mean that ACC will be loaded with l_add finally. And even it is loaded, nevertheless it does not mean that at next step ACC will still contain this value. Do not mix ASM and C-language. If you REALLY need with ASM then create separate .asm file. As about your code - it is wrong due reason I indicated above. Under C-language, you must never rely on fact that MCU registers contain what you load into them. C-language does know nothing about regitsters and cannot operate with them from program directly at point of wiev of end-user (programmer). Regards, Oleg |
Topic | Author | Date |
has anybody used SPI | 01/01/70 00:00 | |
more details please | 01/01/70 00:00 | |
details | 01/01/70 00:00 | |
missing code? | 01/01/70 00:00 | |
How to post code | 01/01/70 00:00 | |
The story so far? | 01/01/70 00:00 | |
no solution | 01/01/70 00:00 | |
all is replied above | 01/01/70 00:00 | |
So you want a solution? | 01/01/70 00:00 | |
code and schematic | 01/01/70 00:00 | |
unconnected reset? | 01/01/70 00:00 | |
How about some clocking ?? | 01/01/70 00:00 | |
Code still illegible! | 01/01/70 00:00 | |
is it C-language? | 01/01/70 00:00 | |
reply of queries | 01/01/70 00:00 | |
complaining | 01/01/70 00:00 | |
Do you want to be helped? | 01/01/70 00:00 | |
Watch window in Keil | 01/01/70 00:00 | |
Registers window in Keil![]() | 01/01/70 00:00 | |
EA | 01/01/70 00:00 |