I would like to call function like port(P0,1,2).i want to assign the values of 0 and 1 to P0.1 and P0.2 using that function prototype only...how can i assign the values to port pins.what are the steps i need to follow...
Thanks in advance
chinnaye
SFRs are NOT indirectly addressable
thus if you want the port (number) as the entry to a function, the only way to do the function woill be to select the port by stacked if's or a switch statement.
Erik
I want the port as the entry function as well as port pin numbers(two pins) also.Here i want to assign the values of 0 &1 to the two port pin numbers.that's it.
So - have you started coding yet? You have been given enough information to be able to write such a function.
I want the port as the entry function as well as port pin numbers(two pins) also.Here i want to assign the values of 0 &1 to the two port pin numbers.that's it. then do it. all possible ways to process has been described above.
i did a study of self modifying code for my thesis you can't do that in a flash based controller.
not true if you can;
program the flash dynamically.
which you can't without spending an (in processor terms) enomous amount of time. Most apps would die if you blocked ints for that long
yea. but you said you cant do it. do you want a copy of my thesis for reference?
Well that thesis should - if it cared about this kind of embedded processors - have noted the big issues with wear and speed for rewriting flash data. Self-modifying code is only relevant when the processor supports running of code in RAM.
look mate. you dont know what my thesis says cause you havent seen it! i just said you can do it here. not my fault that some random guy jumps in and says you cant when you can. sure ram is better but other way works too.
do you want a copy of my thesis for reference? naah, I wrote self modifying code before you were born.
In the olden days, with minicomputers and cycle times of multiple microserconds, self modifying code was, occasionally, a necessity for throughput reasons is parameter based processing. In those days we, sometimes, had to write code that was horrible, but worked faster than clean code.
I REALLY wonder what legit purpose self modifying code has today with nanosecond cycle times.
Well that thesis should - if it cared about this kind of embedded processors - have noted the big issues with wear and speed for rewriting flash data who cares, the issue is to get a thesis written, if it has a practical application (can be used in actual projects) is irrelevant.
naah, I wrote self modifying code before you were born.
you are a right fool matey. how old are you? im 63 and did my thesis as a mature student 5 years ago.
that I did not consider the possibility of a "mature student" allowed you to circumvent everything else (flash wear, time to erase/write flash, irrelevance, ....)
The important thing here is that self-modifying code in flash is really irrelevant for a case where a port pin needs to be toggled. Even doing a pin toggle once/day multiplied with two different pins, would result in 700 flash erase cycles/year.
you are very negative. use some imagination. maybe you should read my thesis. you could learn a lot.
"I REALLY wonder what legit purpose self modifying code has today with nanosecond cycle times."
Self-modifying code can still be relevant today. You can squeeze extra speed out of an expensive graphics filter after you know what matrix weights that are zero. Whenever you have some form of vector processing where a huge amount of data needs to be processed, based on a user-editable configuration, there can be great opportunities for speedup. Of course, it requires that the platform can get both write and execute access to the memory region used.