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.
Hello everybody,
I'm trying to program an Actel 8051s core with Keil uVision3 for a ProASIC3 FPGA and I have some problems.
Keil device database just contains Actel core8051 (a licensed version), but Core8051s is a stripped down version that enables users to add their own peripherals via an APB bus. Actel documentation suggest just to change the header file Reg51.h with the core8051s registers, but it doesn't work.
I'm a noob with this matters, but I suspect that more Keil libraries must be changed in order to adapt core8051s for uVision. Does anyone know how to program this core with Keil??
Thank you!
Thank you for your fast reply. I hope my explanation helps now
Well, frankly, they don't. You haven't even begun to explain how your code "doesn't work".
And similarity between two configurations alone is no justification for a suspicion that stuff won't work. No by a comfortable margin it isn't.
As far as the compiler is concerned, it just generates 8051 instructions: these are the same for all 8051 CPUs - including the Actel core.
Hence there is no difference to "The Libraries".
The only real differences lie in the memory layout, and the SFRs - all of which you can easily specify manually.
There is nothing special or "magic" about the header files supplied by Keil - they are exactly the same as any header file that you write yourself.
The only place that you really need specific support is in the Simulator...
Ok, the code seems to work in Keil, it compiles fine and the debbuging session shows how the DPTR register (a pointer to XDATA for 8051) has the correct memory address, but when I import the HEX code in my FPGA ROM (code memory) the simulation shows how there is no communication with the GPIO.
I will ask my question in a different way:
Does anyone has worked before with this Actel core8051s in Keil? What were the compiler configuration parameters, headers or libraries changed from Actel core8051 device database in order to adapt this core to the Keil software?
Thank you.
Ok Andy, thank you for your explanation, I'll focus on my SFRs configuration.
Thanks
Forget my last post, I was writing it when Andy answered my question.
Not just SFRs - from some of your other posts, it seems that this core gives you the choice of mapping your custom peripherals into either SFR or XDATA space?
"Does anyone has worked before with this Actel core8051s in Keil?"
Not this core, but the Triscend TE5 worked on exactly the same principle...
As far as the Core (and, therefore, the compiler) is concerned, it just reads/writes SFRs or XDATA - it neither knows nor cares what custom peripheral functions may be behind those interfaces...
What "simulation" ?
Are you talking about Keil's CPU simulator in uVision, or something in your FPGA tools?
Yes, the core8051s maps the peripherals into XDATA space starting from address 0xF000.
The simulator is ModelSim, a FPGA software tool that shows the core signals in data and address buses, or movx, write, read, etc. In my Modelsim simulation, GPIO addresses F090 and F0A0 should appear in core address bus, but they don´t. Now that I know that there are more microcontrollers that work in Keil with the same principle (memory mapped peripherals) I will check the HEX file generated by Keil to confirm that the correct instructions are read by the core.
"(memory mapped peripherals)"
The whole point of memory-mapping in any architecture (not just 8051) is that the CPU neither knows nor cares whether these are "real" memory accesses, or accesses to memory-mapped peripherals - the Address and Data bus operations are identical...