Hi Friends, i have two problems:
1-i try writting a code in C using atmel 89c52 to simulate spi.does anyone has a helpful code for me?
2-in the program declaration,i declare an array: int Read_Va[]=0x0D; when i try to read it during the program: ACC=Read_Va;
ACC equal A to D why? Thanks
simulate spi.
What exactly do you mean by that? On a micro, either you do SPI, or you don't. There's really nothing to be simulated.
when i try to read it during the program: ACC=Read_Va;
Then you're doing something rather massively wrong. ACC is not yours to use in a high-level language program.
i did what i need after a research & i don't want anything of you Hans-Bernhard Broeker it's a lesson for you:You must be polite in your reply ,your words like bricks i do right not wrong as you said & use accumlator in my program
No, I'm afraid you are wrong: you cannot rely upon the compiler not to use the accumulator for its own purposes - therefore, you must not use it for your purposes.
You might be lucky (sic?) and happen to get away with it on this occasion - but, if you continue to rely upon it, you will come unstuck!
View all questions in Keil forum