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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/29/07 15:33
Read: times


 
#147570 - Dallas DS89C450 - placing a large array into xram
Hi

I'm using a Dallas DS89C450 microcontroller to control a TFT monitor. I have a large lookup table with the appropriate scaling requirements for the different sources the monitor accepts (NTSC/PAL/VGA/etc).

This is currently stored as a constant in code memory and the monitor works fine. I'd like to add an option to change this on the fly, however, so this will need to be stored as a variable. The table is too large to be stored into data memory so I wish to store it in xram.

When I do this, however, the monitor doesn't work properly and displays random noise on the screen (sometimes looks like memory contents, sometimes it's a constant colour) instead of the input source or a blank screen in the case of no signal.

Here's the array:

code const ST_INPUT_MODE InputModes[] =
{
// |*** MODE & FORMAT ***|*******   ADC VALUES  *******|*****   IMAGE   *******|*****  DETECTION   *****|  		
//   Mode  		Format    Phase  PLL   VCO   Pre   Post  Hst   Vst   Hact  Vact  Hcnt  Htol  Vcnt  Vtol
	{PAL, 		VID_YUV , 0    , 0   , 0   , 0   , 0   , 6   , 5   , 710 , 288 , 0   , 0   , 0   , 0   },  // 
	{NTSC,		VID_YUV , 0    , 0   , 0   , 0   , 0   , 14  , 10  , 700 , 236 , 0   , 0   , 0   , 0   },  // 
//	{NTSC,		VID_YUV , 0    , 0   , 0   , 0   , 0   , 2   , 7   , 720 , 240 , 0   , 0   , 0   , 0   },  // 
	{DVAR_NTSC,	VID_YUV , 0    , 0   , 0   , 0   , 0   , 2   , 2   , 720 , 240 , 0   , 0   , 0   , 0   },  // 
	{NTSC_MONO,	VID_YUV , 0    , 0   , 0   , 0   , 0   , 2   , 2   , 720 , 240 , 0   , 0   , 0   , 0   },  // 
	{VGA_60,        GRA_RGB , 16   , 800 , 0x14, 0   , 0   , 109 , 31  , 640 , 480 , 1589, 32  , 525 , 10  },  // 
	{SVGA_60,  	GRA_RGB , 18   , 1056, 0x60, 0   , 0   , 177 , 22  , 800 , 600 , 1320, 26  , 628 , 12  },  // 
	{XGA_60,	GRA_RGB , 17   , 1344, 0x70, 0   , 0   , 260 , 27  , 1024, 768 , 1034, 20  , 806 , 16  },  // 
	{ARI5955,	VID_RGB , 16   , 1261, 0x18, 1   , 1   , 195 , 18  , 1048, 288 , 0   , 0   , 0   , 0   },  // 
//	{ARI5955,	VID_RGB , 16   , 1139, 0x18, 1   , 1   , 175 , 10  , 960 , 300 , 0   , 0   , 0   , 0   },  // 
	{TIMING_MAX}
};


Here's a definition of the structure:

typedef struct
{
        BYTE 	VideoMode;				// Input video mode
	BYTE    Format;
	BYTE	Phase;					// Initial phase value
	WORD	PLLdivisor;				// 
	BYTE	VCO;					// Initial PLL charge pump setting	
	BYTE    PreCoast;				//
	BYTE	PostCoast;				//
	WORD	Hstart;					// H start for capture window	
	BYTE	Vstart;					// V start for capture window
	WORD	Hactive;				// H active for capture window
	WORD	Vactive;				// V active for capture window
	WORD	Hcount;					// H count for detection
	BYTE	Htol;					// H tolerance		
	WORD	Vcount;					// V count for detection
	BYTE	Vtol;					// V tolerance
	
} ST_INPUT_MODE;


A BYTE is defined as an unsigned char, a WORD is defined as an unsigned int

On removing the code const keywords the compiler compiles the code but the problem arises

I'm using Keil uVision 3 (C Compiler 8.01) configured for the Dallas DS89C450 using the large memory model. I'm programming the device using the MTK 2 loader at 57600 baud. The processor is running at 11.0592MHz. I'm working with the Genesis GM6015 chip


Thanking you in advance

List of 16 messages in thread
TopicAuthorDate
Dallas DS89C450 - placing a large array into xram            01/01/70 00:00      
   of course it does            01/01/70 00:00      
      OP is using large memory model            01/01/70 00:00      
         Yep - I'm using the large memory model            01/01/70 00:00      
   large memory model and timing            01/01/70 00:00      
      I'm using the XRAM inside the DS89C450            01/01/70 00:00      
         Do Not Forget pdata            01/01/70 00:00      
            I'll look into this            01/01/70 00:00      
   Divide and conquer            01/01/70 00:00      
      Thanks - I will try this            01/01/70 00:00      
         one other thing ...            01/01/70 00:00      
         You're welcome            01/01/70 00:00      
            We've fixed it            01/01/70 00:00      
   It's been a while...            01/01/70 00:00      
      Thanks - That's fixed it!            01/01/70 00:00      
   Thanks for your help            01/01/70 00:00      

Back to Subject List