This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Question about sbit definitions

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?

Parents
  • Andrew,

    I was planning to do that indirection only once on a vendor request and then after that the port address remains the same for the entire duration. Where as adding an IF condition would be checked almost every write to that port address.

    Also writing to both the pins could cause some side affect as those port pins are mapped to a different pin in the FPGA on that condition.

    I have atleast 5 different pins that need to change during the program execution and they all execute atleast 40,000 times during the intialization. Our application now takes about 5 sec to initialize and the customers are complaining already and after this IF condtion I am seeing it atleast 10 mins which is not acceptable.

    Please throw some other alternatives? . Please...

Reply
  • Andrew,

    I was planning to do that indirection only once on a vendor request and then after that the port address remains the same for the entire duration. Where as adding an IF condition would be checked almost every write to that port address.

    Also writing to both the pins could cause some side affect as those port pins are mapped to a different pin in the FPGA on that condition.

    I have atleast 5 different pins that need to change during the program execution and they all execute atleast 40,000 times during the intialization. Our application now takes about 5 sec to initialize and the customers are complaining already and after this IF condtion I am seeing it atleast 10 mins which is not acceptable.

    Please throw some other alternatives? . Please...

Children