I'm trying to simulate a simple design (written in assembler), in uVision4, that has a few memory mapped peripherals and uses P2 for GPIO. In "options for target" I set "Off-chip Ddata memory" to: Start: 0x0000 Size: 0x0100 When I run the simulator, external memory access is being done using P2, which causes problems when the value of P2 changes for GPIO. While searching the forum posts I found some mention of P2 addressing being the default for PDATA access, but found nothing about how to disable this for the simulator. Perhaps a parameter passed to S8051? Any ideas or insight would be appreciated.
Do you think that the processor have any option to configure which processor port that should be used for addresses and/or data, when accessing external memory?
If you really want to use "any" port, then you can implement helper functions:
uint8_t read_byte(uint8_t addr); void write_byte(uint8_t addr,uint8_t val);
And have them use whatever port pins you want. But then you obviously need to take care of R/W and latching, besides just driving or reading address and/or data values.
Um, perhaps I have not been clear enough. This is a simulator configuration question. I'm trying to find out if there is a way to configure the S8051 module so that P2 is not used for external memory addressing, since in my design (and many others I suspect) only the address lines supplied by P0 give a more than sufficient address space, and GPIO pins are at a premium. Thanks, -Reed
This is a simulator configuration question. I'm trying to find out if there is a way to configure the S8051 module so that P2 is not used for external memory addressing, since in my design (and many others I suspect) only the address lines supplied by P0 give a more than sufficient address space, and GPIO pins are at a premium.
I know of no '51 processor that will toggle !R/!W without loading 'something' on P2. Thus it is not the simulator, but your 'design' that is faulty.
Erik
Really?
Aren't there some processors that only support an 8-bit external address?
View all questions in Keil forum