Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/15/09 13:32
Read: times


 
#166089 - Memmory mapping question/ Bord fixed
Responding to: ???'s previous message
I've done some testing on te PCB and discovered that there was a fault in the powersupply, changed the dc-dc converter and now everything is running as it should.
A lesson in not to forget the basics of electronics 8-)...

Now i've been doing some tests concerning the external memmory features and i am able to get the signals in and out (ALE, /RD, /WR, P0AD & P2A)
But now comes the part of the memory mapping:

Let me re sketch the situation since I do not yet have al the hardware required to fully test. I've made some assumptions (this is theoretical) on XDATA and memory mapping:

Hardware:
I'm thinking on making a bus system where there are 4 identical PCB's linked together trough the AD lines. (P0 & P2)
On each PCB there are 4 identical components which each have 28 registers that can be programmed. (thus using 6 address lines) i am using the upper 2 latched address lines to select which of the 4 devices to program.
P2.0 and P2.1 are used to enable communication with each individual PCB board.

Code:
Since the devices are similar I would like to memory map the struct specified in the external.h file 16 times to the corresponding addressed device.

* Can i just do so by assigning an address to it as done in the parameter.c file?


* What memory model should I choose best, do i really need the large memory specifier since, according to the data sheet enabling and disabling EXTRAM bit in the AUXR register should activate switching between internal and external memory access. I ask this question cause I would also like to keep use of the internal XRAM of the chip.


* Can it be done by using the #pragma large in the parameter.c file?

*aside of setting the size and start address of the XRAM do there need to be made any other alterations to the linker?




Kind regards
Rob


main.c
#include "at89c51cc03.h"
#include "compiler.h"
#include "hardware.h"
#include "External/parameters.h"


main (void)
{
unsigned long xdata x=0;
AUXR=0x15;              //Disabling external RAM

while (1)
{
x=0;
while(x<150000)
        {
        x++;
        }

AUXR=0x17;              //enabling external RAM
d11.par1=0xXX;  //Programming all devices
...
d11.par27=0xXX;
d12.par1=0xXX;
...
d12.par27=0xXX;

...


d44.par1=0xXX;
...
d44.par27=0xXX;
AUXR=0x15;              //Disabling external RAM

}
 


pârameter.c
#include "at89c51cc03.h"
#include "System/compiler.h"
#include "System/hardware.h"
#include "parameters.h"


xdata device d11 _at_ 0x0000;      

xdata device d12 _at_ 0x0040;        
                                 
xdata device d13 _at_ 0x0080;        

xdata device d14 _at_ 0x00C0;

xdata device d21 _at_ 0x0100;

xdata device d22 _at_ 0x0140;
                                 
xdata device d23 _at_ 0x0180;

xdata device d24 _at_ 0x01C0;

xdata device d31 _at_ 0x0200;

xdata device d32 _at_ 0x0240;
                                 
xdata device d33 _at_ 0x0280;

xdata device d34 _at_ 0x02C0;

xdata device d41 _at_ 0x0300;

xdata device d42 _at_ 0x0340;
                                 
xdata device d43 _at_ 0x0380;

xdata device d44 _at_ 0x03C0;
 


parameter.h

#include "at89c51cc03.h"
#include "System/compiler.h"
#include "System/hardware.h"

#ifndef _PARAMETERS_H
#define _PARAMETERS_H

typedef struct
                {
                unsigned char par0;
                ...
                unsigned char par27;
                }
                device;

#ifdef _PARAMETERS_C

xdata device ;

#else


extern xdata device ;
#endif
#endif
 



List of 19 messages in thread
TopicAuthorDate
AT89c51cc01 and External memory (keil/C51)            01/01/70 00:00      
   Cross posted            01/01/70 00:00      
   Is your problem with FLIP ?            01/01/70 00:00      
      No, think it's keil compiler            01/01/70 00:00      
         Sounds like an error in the data sheet            01/01/70 00:00      
         bible time            01/01/70 00:00      
            Itterations            01/01/70 00:00      
               just won't get flashed into the µc??            01/01/70 00:00      
               The compile will compile what you tell it            01/01/70 00:00      
                  RE: your example does not access any xdata at all            01/01/70 00:00      
         RE: Rob Stoffels said:I think there is something that needs            01/01/70 00:00      
            Going to try something different            01/01/70 00:00      
               Broken Boards?            01/01/70 00:00      
                  Memmory mapping question/ Bord fixed            01/01/70 00:00      
                     If I read this correctly            01/01/70 00:00      
                        Missunderstanding            01/01/70 00:00      
                           xdata will just be whatever EXTRAM says            01/01/70 00:00      
                           do you have any external RAM?            01/01/70 00:00      
   CC03 is working            01/01/70 00:00      

Back to Subject List