I am using Texas Instruments' TAS1020 USB Streaming Audio Microcontroller and I use uVision2.
I have defined some variables in xdata segment inorder to pass them as shared data to the functions provided by the on-chip PROM routines.
I also have noticed in some reference source codes that they set: P2=0xFA in start of their program which is supposed to enable access to the xdata segment starting at address 0xFA00. I have also done this tricky assignment
I used a simple test program, I write to a variable in the xdata and then printf it in the terminal output and surprisingly I see that my assignment to the variable was not performed. This seems that kind of xdata segment is read-only! or I can not access it.
Any Ideas?
Dear friends I have found the solution:
The pdata segment starts at address 0xFA10 in TAS1020. In addition to Setting the P2 at run-time to 0xFA which means the high byte of 16-bit pdata starting address sould be 0xFA (0xFAxx), I had to set the starting address 0xFA10 explicitly in the B51 linker settings in order that at the link time the variables could be assigned correct addresses.