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 have an unusual problem which i'd very much like some help with. i'm using floating point notation in my project, however it is a defacto 16 bit floating point system with a hardware engine doing all the hard arthmetic work. this engine is mapped into the 8052 sfr space. this system has the problem that when debugging in an fpga we can't use the uv2 to view the 16 bit floats in useful format. ie we can't view '3.14' in the watch window, we get '0xABCD'. an attempt to work around this problem has been to get the hardware engine to report its output in 32 bit ieee float format. the idea was that i could then park a 'float' type _at_ that location and watch it in the view window. the obvious (with hindsight) problem is that it is not possible to declare variables in the sfr space. nor was i able to make a pointer point to that space. is there anything else that i can do to view this data? any thoughts or opinions very welcome, robert young
nor was i able to make a pointer point to that space The 8051 architecture uses the high bit of the internal memory address in conjunction with the addressing mode to figure out what memory space to access. 00H-7Fh is 128 bytes of internal RAM for both direct and indirect addressing. 80H-FFH is SFR space for instructions using direct addressing. 80H-FFH is the indirect space (another 128 bytes of RAM) for instructions that do indirect addressing. a uVision Debug Function With a big enough sledgehammer, I think you could make it work. Something like:
printf ("%f", ((U32)r1 << 24 + (U32)r2 << 16 + (U32)r3 << 8 + r4));
printf ("%f", r1, r2, r3, r4);