CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

SED1335 Driver Update

 
Post new topic   Reply to topic    CCS Forum Index -> Code Library
View previous topic :: View next topic  
Author Message
Sergeant82d



Joined: 01 Nov 2009
Posts: 55
Location: Central Oklahoma

View user's profile Send private message

SED1335 Driver Update
PostPosted: Wed Dec 02, 2009 5:53 pm     Reply with quote

Thanks to the efforts of PCM_Programmer, Will Reeve and MikeP, the problems many of us have had with the SED1335 Driver included in CCS's Library have been identified and corrected.

If you are having problems with vertical lines (every 8th column) missing, or smearing, or likely even if you are not, you need to make the following three changes to your SED1335 Driver:

1)
There's a bug in this function in sed1335.c at least up to ver 4.088. The expression reading the high part is wrong. It's adding 1 to the address before it's cast to an int8 pointer. That's wrong. It should be cast to an int8* before the 1 is added to it.

Code:

Quote:
int16 getCursorAddress()
{
int16 addr;
glcd_sendCMD(GLCD_CMD_GET_CSR_ADDR);
TGLCD_DATA
*(int8*)(&addr ) = glcd_readByte(); // Read low part

*(int8*)(&addr + 1) = glcd_readByte(); // Read high part   /// This is wrong

return addr;
}


It should be changed to this.

Code:
*((int8*)&addr + 1) = glcd_readByte();   


2)
Code:

// Purpose:    Get the current address of the cursor
// Outputs:    A 16 bit integer containing the cursor address
int16 getCursorAddress()
{
   int16 addr;

   glcd_sendCMD(GLCD_CMD_GET_CSR_ADDR);
   TGLCD_COMMAND // changed from TGLCD_DATA
   *(int8*)(&addr    ) = glcd_readByte();  // Read low part
   *(int8*)(&addr + 1) = glcd_readByte();  // Read high part

   return addr;
}


And 3)

Code:


// Purpose:    Get a byte of data from the display at the address
// Inputs:     A 16 bit integer containing the address
// Outputs:    An 8 bit integer with the read data
int8 getData(int16 addr)
{
   setCursorAddress(addr);
   glcd_sendCMD(GLCD_CMD_DISPLAY_READ);
   TGLCD_COMMAND // changed from TGLCD_DATA
   return glcd_readByte();
}



Note in 2 & 3 the TGLCD_COMMAND, where it has been changed from TGLCD_DATA. For further info on what is going on, see this post http://www.ccsinfo.com/forum/viewtopic.php?t=21096

Hope this helps.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> Code Library All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group