We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am using the uVision 3 (ver. 3.72) tool and working with a Silicon Labs 8051F340 MCU. I need to map a device (an FPGA with registers) into external memory and access it with the MCU. There are not very many FPGA registers to access.
I am trying to use Split Mode without Bank Select and a multiplexed address/data bus. I'm looking for some guidance in setting up the target options, startup assembly code, and anything else that's necessary.
I have code compiling which is basically:
volatile uint8_t xdata *fpga_reg = (volatile uint8_t xdata *)0x1000; ... *fpga_reg = 0x12;
Thanks in advance for any help.
I can see that there is a variable XDATASTART specified in STARTUP.A51, however, I do not want any of the xdata memory cleared (set to 0) because that is where the FPGA registers are going to exist. I just need to let the F340 know the external registers are there.
I am not talking about XDATASTART (which, of course, must be set, bot about the SFRS specifying external memory.
0 is set in startup, what follows startup before main() will set any other values and miss if the SFRs are not set in startup.
thus usnigned char xdata Ralph = 47;
will not happen if the SFRs are not set in startup.
While it may be that in this particular case there is no absolute requirement to set these SFRs in startup, I recommend that you, for reasons of "always doing things the same way, which helps you not forget how" do it in startup.
Erik