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.
Thanks for the post.
I have a couple of follow on questions:
1) can you point me to which SFRs you are referring to that I need to initialize, or point me to an example that details this information.
2) why is using a multiplexed address/data bus bad for the FPGA?
Thanks.
1) can you point me to which SFRs you are referring to that I need to initialize, or point me to an example that details this information. the datasheet will tell you 2) why is using a multiplexed address/data bus bad for the FPGA? then you will have to demultiplex in the FPGA (which is, of course, possible - but)
Erik
1) Maybe I was a bit confused. I have code that initializes the EMI0CN, EMI0CF, and EMI0TC. It is in the C code after main is called. Are these what you are referring to? Or do I need to define the external memory region some other way?
2) I am counting on the FPGA to demux the address and data bus.
1) Maybe I was a bit confused. I have code that initializes the EMI0CN, EMI0CF, and EMI0TC. It is in the C code after main is called. Are these what you are referring to? Or do I need to define the external memory region some other way? the code before main pre-process xdata, thus it is imoerative that all meomory configuration is done at the start of (a local copy of) startup.a51
the code before main pre-process xdata, thus it is imperative that all memory configuration is done at the start of (a local copy of) startup.a51
Erik,
Do you have trouble keeping up with those keys on your keyboard that keep jumping around?
But it really is imoerative to care about your meomory configuration.
Besides, he just happens to have an understimulated ring finger requesting some attention.
Does there happen to be any examples of modifying STARTUP.A51 to accommodate an external device?
http://www.keil.com/support/man/docs/c51/c51_ap_customfiles.htm
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.