Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


8051 port - PDATA Pages for task stacks/etc

Posted by John W. on October 15, 2007

For those of you working with the 8051 - have you tried using PDATA pages to store the tasks stack/context?

This seems to be a viable approach for devices like the C8051F120 - and obviates having to do the XRAM copy/restore step.

John W.

RE: 8051 port - PDATA Pages for task stacks/etc

Posted by sotd on October 16, 2007
Is PDATA not limited to 256 bytes?

RE: 8051 port - PDATA Pages for task stacks/e

Posted by John W. on October 16, 2007
Each PDATA page is limited to 256 bytes - but you can have multiple pages.


RE: 8051 port - PDATA Pages for task stacks/e

Posted by David Hawks on October 16, 2007
PDATA is a method to use eight bit addressing to access external memory. The lower eight bits of the 16-bit address are encoded in the instruction while the upper eight bits are set by some other register outside of the instruction.

I don't see how this obviates an XRAM copy/restore step as the hardware stack must always reside in internal memory. What am I missing?

RE: 8051 port - PDATA Pages for task stacks/e

Posted by John W. on October 17, 2007
Hello David,

I think I should have worded, "and obviates" - to "could obviate".

I was a little unclear on this myself - evidently IAR limits you to one PDATA page at link-time - but you can switch PDATA
pages using: (according to a reliable source:)

"The C8051F120 has 16 pages of PDATA space. The datasheet refers to this space as XRAM. Switching between pages is accomplished by setting the PGSELx bits in the EMI0CN SFR. In assembly, this can be accomplished by a “mov” instruction, which will take 3 clock cycles."

Someone mentioned to me this could obviate the XRAM copy step - in reality, as you point out - I don't think it does.

I think the person that mentioned this to me thought everything could be declared __pdata_reentrant with the IAR compiler - but
didn't think about the hardware stack in IDATA. Since the IAR compiler has it's own routines to copy stacks for the reentrant functions - I think the thinking was/is if a task can be assigned a PDATA page - that the task contexts could be paged effectively.
I suppose this could be done - but you still have the to/from copy step to the PDATA page that has to be done. This is also not a good use of XRAM if your app. becomes somewhat XRAM limited.

John W.

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists