I recently used 51 single-chip microcomputer as a small project. When programming, the following error occurs:
Main. C (284): Error c249: 'pdata': Segment too large
Main. C (284): Error c249: 'data': Segment too large
At that time, I still did not know what was going on. Later I found that the ram of 51 single-chip microcomputer was relatively small and only B, so I had to save the effort to use it.
Use uchar code XX [10] = when you do not need to change the array definition.
Based on your data usage, you can choose from the following options:
Data: the direct addressing in-chip RAM zone is B (H ~ 7fh)
Bdata: The bit addressing area (20 h ~ 2fh), allowing both byte and bit access
Idata: The on-chip RAM zone indirectly accessed by the microcontroller, allowing access to all on-chip RAM
Pdata: The off-board RAM that RI indirectly accesses is 256b (00h ~ FFH)
Xdata: External Ram indirectly accessed by dptr, allowing access to all 64 kB external RAM (Bytes H ~ Ffffh)
Code: 64 kB program storage area ROM of Single Chip Microcomputer
51 meanings of key words data, bdata, idata, pdata, xdata, and code in study notes