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 support@ccsinfo.com

Inclined at 90 ° character (error code)??

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
vortexe90



Joined: 26 Feb 2013
Posts: 30
Location: Algeria

View user's profile Send private message

Inclined at 90 ° character (error code)??
PostPosted: Sun Nov 10, 2013 3:47 pm     Reply with quote

Hi guys ..........

Inclined at 90 ° character, is that the problem is in the data characters or subroutine
Resolution : 8x12.



data array :


Code:
const BYTE TEXT_8x12_1[21][12]={ 0,0,0,0,0,0,0,0,0,0,0,0                // ' ' 32
                        0,24,60,60,60,24,24,0,24,24,0,0,                // '!' 33
                        54,54,54,20,0,0,0,0,0,0,0,0,                    // '"' 34
                        0,108,108,108,254,108,108,254,108,108,0,0,      // '#' 35
                        24,24,124,198,6,60,120,192,198,124,24,24,       // '$' 36     24,24,124,198,192,120,60,6,198,124,24,24, 
                        0,0,0,98,102,12,24,48,102,198,0,0,              // '%' 37
                        0,56,108,56,56,118,246,206,204,118,0,0,         // '&' 38
                        12,12,12,24,0,0,0,0,0,0,0,0,                    // ''' 39
                        0,12,24,48,48,48,48,48,24,12,0,0,               // '(' 40
                        0,48,24,12,12,12,12,12,24,48,0,0,               // ')' 41
                        0,0,0,108,56,254,56,108,0,0,0,0,                // '*' 42
                        0,0,0,24,24,126,24,24,0,0,0,0,                  // '+' 43
                        0,0,0,0,0,0,0,12,12,12,24,0,                    // ',' 44
                        0,0,0,0,0,254,0,0,0,0,0,0,                      // '-' 45
                        0,0,0,0,0,0,0,0,24,24,0,0,                      // '.' 46
                        0,0,2,6,12,24,48,96,192,128,0,0,                // '/' 47
                        0,124,198,206,222,246,230,198,198,124,0,0,      // '0' 48
                        0,24,120,24,24,24,24,24,24,126,0,0,             // '1' 49
                        0,124,198,198,12,24,48,96,198,254,0,0,          // '2' 50
                        0,124,198,6,6,60,6,6,198,124,0,0,               // '3' 51
                        0,12,28,60,108,204,254,12,12,12,0,0             // '4' 52
};
                       
const BYTE TEXT_8x12_2[21][12]={ 0,254,192,192,192,252,6,6,198,124,0,0, // '5' 53
                        0,124,198,192,192,252,198,198,198,124,0,0,      // '6' 54
                        0,254,198,12,24,48,48,48,48,48,0,0,             // '7' 55
                        0,124,198,198,198,124,198,198,198,124,0,0,      // '8' 56
                        0,124,198,198,198,126,6,6,198,124,0,0,          // '9' 57
                        0,0,0,12,12,0,0,12,12,0,0,0,                    // ':' 58
                        0,0,0,12,12,0,0,12,12,12,24,0,                  // ';' 59
                        0,12,24,48,96,192,96,48,24,12,0,0,              // '<' 60
                        0,0,0,0,254,0,254,0,0,0,0,0,                    // '=' 61
                        0,96,48,24,12,6,12,24,48,96,0,0,                // '>' 62
                        0,124,198,198,12,24,24,0,24,24,0,0,             // '?' 63
                        0,124,198,198,222,222,222,220,192,126,0,0,      // '@' 64
                        0,56,108,198,198,198,254,198,198,198,0,0,       // 'A' 65
                        0,252,102,102,102,124,102,102,102,252,0,0,      // 'B' 66
                        0,60,102,192,192,192,192,192,102,60,0,0,        // 'C' 67
                        0,248,108,102,102,102,102,102,108,248,0,0,      // 'D' 68
                        0,254,102,96,96,124,96,96,102,254,0,0,          // 'E' 69
                        0,254,102,96,96,124,96,96,96,240,0,0,           // 'F' 70
                        0,124,198,198,192,192,206,198,198,124,0,0,      // 'G' 71
                        0,198,198,198,198,254,198,198,198,198,0,0,      // 'H' 72
                        0,60,24,24,24,24,24,24,24,60,0,0                // 'I' 73
};
                       
const BYTE TEXT_8x12_3[21][12]={ 0,60,24,24,24,24,24,216,216,112,0,0,   // 'J' 74
                        0,198,204,216,240,240,216,204,198,198,0,0,      // 'K' 75
                        0,240,96,96,96,96,96,98,102,254,0,0,            // 'L' 76
                        0,198,198,238,254,214,214,214,198,198,0,0,      // 'M' 77
                        0,198,198,230,230,246,222,206,206,198,0,0,      // 'N' 78
                        0,124,198,198,198,198,198,198,198,124,0,0,      // 'O' 79
                        0,252,102,102,102,124,96,96,96,240,0,0,         // 'P' 80
                        0,124,198,198,198,198,198,198,214,124,6,0,      // 'Q' 81
                        0,252,102,102,102,124,120,108,102,230,0,0,      // 'R' 82
                        0,124,198,192,96,56,12,6,198,124,0,0,           // 'S' 83
                        0,126,90,24,24,24,24,24,24,60,0,0,              // 'T' 84
                        0,198,198,198,198,198,198,198,198,124,0,0,      // 'U' 85
                        0,198,198,198,198,198,198,108,56,16,0,0,        // 'V' 86
                        0,198,198,214,214,214,254,238,198,198,0,0,      // 'W' 87
                        0,198,198,108,56,56,56,108,198,198,0,0,         // 'X' 88
                        0,102,102,102,102,60,24,24,24,60,0,0,           // 'Y' 89
                        0,254,198,140,24,48,96,194,198,254,0,0,         // 'Z' 90
                        0,124,96,96,96,96,96,96,96,124,0,0,             // '[' 91
                        0,0,128,192,96,48,24,12,6,2,0,0,                // '\' 92
                        0,124,12,12,12,12,12,12,12,124,0,0,             // ']' 93
                        16,56,108,198,0,0,0,0,0,0,0,0                   // '^' 94
};
                       
const BYTE TEXT_8x12_4[21][12]={ 0,0,0,0,0,0,0,0,0,0,0,255,             // '_' 95
                        24,24,24,12,0,0,0,0,0,0,0,0,                    // '`' 96
                        0,0,0,0,120,12,124,204,220,118,0,0,             // 'a' 97
                        0,224,96,96,124,102,102,102,102,252,0,0,        // 'b' 98
                        0,0,0,0,124,198,192,192,198,124,0,0,            // 'c' 99
                        0,28,12,12,124,204,204,204,204,126,0,0,         // 'd' 100
                        0,0,0,0,124,198,254,192,198,124,0,0,            // 'e' 101
                        0,28,54,48,48,252,48,48,48,120,0,0,             // 'f' 102
                        0,0,0,0,118,206,198,198,126,6,198,124,          // 'g' 103
                        0,224,96,96,108,118,102,102,102,230,0,0,        // 'h' 104
                        0,24,24,0,56,24,24,24,24,60,0,0,                // 'i' 105
                        0,12,12,0,28,12,12,12,12,204,204,120,           // 'j' 106
                        0,224,96,96,102,108,120,108,102,230,0,0,        // 'k' 107
                        0,56,24,24,24,24,24,24,24,60,0,0,               // 'l' 108
                        0,0,0,0,108,254,214,214,198,198,0,0,            // 'm' 109
                        0,0,0,0,220,102,102,102,102,102,0,0,            // 'n' 110
                        0,0,0,0,124,198,198,198,198,124,0,0,            // 'o' 111
                        0,0,0,0,220,102,102,102,124,96,96,240,          // 'p' 112
                        0,0,0,0,118,204,204,204,124,12,12,30,           // 'q' 113
                        0,0,0,0,220,102,96,96,96,240,0,0,               // 'r' 114
                        0,0,0,0,124,198,112,28,198,124,0,0              // 's' 115
};
                       
const BYTE TEXT_8x12_5[11][12]={ 0,48,48,48,252,48,48,48,54,28,0,0,     // 't' 116
                        0,0,0,0,204,204,204,204,204,118,0,0,            // 'u' 117
                        0,0,0,0,198,198,198,108,56,16,0,0,              // 'v' 118
                        0,0,0,0,198,198,214,214,254,108,0,0,            // 'w' 119
                        0,0,0,0,198,108,56,56,108,198,0,0,              // 'x' 120
                        0,0,0,0,198,198,198,206,118,6,198,124,          // 'y' 121
                        0,0,0,0,254,140,24,48,98,254,0,0,               // 'z' 122
                        0,14,24,24,24,112,24,24,24,14,0,0,              // '{' 123
                        0,24,24,24,24,0,24,24,24,24,0,0,                // '|' 124
                        0,112,24,24,24,14,24,24,24,112,0,0,             // '}' 125
                        0,70,169,168,72,8,9,6,0,0,0,0                   // Degree C symbol (oC) 126
//                        0,118,220,0,0,0,0,0,0,0,0,0,                    // '~' 126
};


subroutine :
Code:
void glcd_text111(int16 x, int16 y, char* textptr, int8 size, int1 color)
{
   int8 j, k, l, m;                       // Loop counters
   int8 pixelData[12];                     // Stores character data

   for(; *textptr != '\0'; ++textptr, ++x)// Loop through the passed string
   {
       if(*textptr < '5') // Checks if the letter is in the first text array
       memcpy(pixelData, TEXT_8x12_1[*textptr-' '], 12);
    else if(*textptr < 'J') // Check if the letter is in the second array
       memcpy(pixelData, TEXT_8x12_2[*textptr-'5'], 12);
    else if(*textptr < '_') // Check if the letter is in the third array
       memcpy(pixelData, TEXT_8x12_3[*textptr-'J'], 12);
    else if(*textptr < 't') // Check if the letter is in the forth array
       memcpy(pixelData, TEXT_8x12_4[*textptr-'_'], 12);
    else if(*textptr <= '~') // Check if the letter is in the fifth array
       memcpy(pixelData, TEXT_8x12_5[*textptr-'t'], 12);
    else
       memcpy(pixelData, TEXT_8x12_1[0], 12);   // Default to space
   
       
      // Handles newline and carriage returns
      switch(*textptr)
      {
         case '\n':
            y += 12*size + 1;
            continue;
         case '\r':
            x = 0;
            continue;
      }


the main lines code :
Code:
     CHAR PP[]="T6253ABab$ )°C!";
     
     glcd_text111(40, 20, PP, 1, 1);
     glcd_text57(40, 50, PP, 1, 1);
oxo



Joined: 13 Nov 2012
Posts: 219
Location: France

View user's profile Send private message

Re: Inclined at 90 ° character (error code)??
PostPosted: Mon Nov 11, 2013 4:29 am     Reply with quote

vortexe90 wrote:
Inclined at 90 ° character, is that the problem is in the data characters or subroutine


The answer is *either*.. Smile

You can either change the character definitions, OR change to code to work with the characters as they are.
temtronic



Joined: 01 Jul 2010
Posts: 9127
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Nov 12, 2013 7:03 am     Reply with quote

The third answer can be the LCD module !

Are the pixels actually square in shape? Check the datasheet !If not, then simply rotating an 8by12 character data 90* into a 12by8 character will never be the same.

If they are square, then Oxo is right.Try a simple test of a few 90* characters and display them as well as your 'test data' to compare.
I did see the $ sign was 'funny' on the display.....hmmm...


Your 'program' isn't complete so I can't comment on the 'subroutine' that actually takes the data and displays it.

hth
jay
dyeatman



Joined: 06 Sep 2003
Posts: 1913
Location: Norman, OK

View user's profile Send private message

PostPosted: Tue Nov 12, 2013 8:20 am     Reply with quote

This looks like Proteus/ISIS is that what you are using?
_________________
Google and Forum Search are some of your best tools!!!!
temtronic



Joined: 01 Jul 2010
Posts: 9127
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Nov 12, 2013 8:25 am     Reply with quote

Yikes...I never thought of that !!! Then again I've had a headache for 53 hours straight so I'm a we bit tired..
That'll be the error right there....'simulation'.......sigh........

jay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Nov 12, 2013 10:52 am     Reply with quote

You can see the reason for the problem by comparing the two font tables.

Here is part of the table from the first post. Notice how the dots for the !
symbol are spread over several bytes:
Quote:
const BYTE TEXT_8x12_1[21][12]={
0,0,0,0,0,0,0,0,0,0,0,0 // ' ' 32
0,24,60,60,60,24,24,0,24,24,0,0, // '!' 33
54,54,54,20,0,0,0,0,0,0,0,0, // '"' 34


Here's the font table from the CCS driver file, glcd.c. Notice how the
dots for the ! symbol are contained in one byte.
Quote:

const BYTE TEXT[51][5] ={
0x00, 0x00, 0x00, 0x00, 0x00, // SPACE
0x00, 0x00, 0x5F, 0x00, 0x00, // !
0x00, 0x03, 0x00, 0x03, 0x00, // "


The two tables are not compatible. The CCS font table assumes that your
graphic LCD has a memory map, such that one column in a character cell
can be written as a single byte. The upper font table is not written
that way. If you try use the CCS driver methods (using memcpy) with
the first font table, you will get sideways characters.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion 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