Hi, I am using the Keil uVision 2 software to develop a firmware driver. I have one technical related to the sbit definitions. Lets say i have couple of sbit definitions as follows: sbit JTAG_TDO = 0xB0+0; sbit ALT_JTAG_TDO = 0x80+0; In the course of program execution, based on some condition I want JTAG_TDO point to the ALT_JTAG_TDO pin so that whatever i write to JTAG_TDO gets written to ALT_JTAG_TDO at the port address 0x80+0 instead of the original 0xB0+0. I tried doing &JTAG_TDO = &ALT_JTAG_TDO and that raised a compiled error. Please let me know how to dynamically change the port pin addressing?
Please let me know how to dynamically change the port pin addressing? Sorry, no can do. There is no indirect addressing of bits. my method if (ralph) JTAG_TDO = true; else ALT_JTAG_TDO = TRUE: Erik
The code gets executed thousands of times and having an IF condition would greatly affect the performance of our firmware. Is there any other way I could this?.
"having an IF condition would greatly affect the performance of our firmware" Are you sure? Have you actually checked the generated code? How much overhead did you think indirection would have added?
there is a wondeful little document called "the bible" which you, evidently, forgot to study before embarling on this project. Well better late than never here are the links to "the bible" Chapter 1 http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_ARCH_1.pdf chapter 2 http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_PROG_GUIDE_1.pdf chapter 3 http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_HARDWARE_1.pdf Erik Or are ju just a cidiot that can not be bothered with knowing anything about the chip you are using.
Is there any other way I could this? Not really, because the limitation is in the hardware, not the software, so no amount of software trickery is really going to get you rid of it. You can reduce the effect by moving the decision between these two registers out of tight loops, but that's about it.