Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SSD1306 Dispaly any char,number

Status
Not open for further replies.

KVSN91

Junior Member level 2
Joined
Aug 27, 2015
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
182
hii..
I am dealing With SSD1306 Oled Display.I initiakized & enble and all is okThe display init, But i did not Understand How to Display dot(.),any Charecter & number
could u give me a sample code for me
 

Hi,

If the display controller has no built in character set (dot pattern for each character), then you need to build it in your software.
Decide what dots needs to be active to show a character. Often there is a character set with 5 x 7 dots.
Then you have to decide where to place the "dots" on the display.

Klaus
 

    V

    Points: 2
    Helpful Answer Positive Rating
k sir , i did'nt understand how to write dot pattern to display... is there any example code for me to understand cliearly
 

Typing in "ssd1306 example code" at google gives me a lot of promising links, e.g. the adafruit libraries.
 

i am read some articles but i cann't understand .in some they are giving examples of fonts dispaly pics etc but i want display characters numebers using dots because is there any code for me
 

Dot matrix displays use fonts to display anything. You need to use fonts, too.
 

I tried most but i cann't display i am see more exmples i didnt understand how to do help me to how to display is there any code give me
 

hi sir, is there any code for i tried mostly i ann't display anything
 

The correct way is to reserve a memory window in RAM, draw a symbol there and after that upload it to LCD via fill widow method.
 

hi sir

i wrote my cod like this


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
void Init_Display(void)
{
    Dispaly();
    //Clear_Screen(0x00);
}
 
void Dispaly(void)
{
   
  RES=0;
  Delay(0xFFF); 
  RES=1;
  
  Delay(0xFF);
    
  Write_Command(0xAE);    // Turn Off Display Panel
 
  Write_Command(0xA8);    // Set MUX Ratio
  Write_Command(0x3F);
 
  Write_Command(0xD3);    // Set Display Offset
  Write_Command(0x00);
 
  Write_Command(0x40);    // Set DisplayStart Line
 
  Write_Command(0xA1);    // Set Segment re-map
 
  Write_Command(0xC0);    // Set COM Output Scan Direction
 
  Write_Command(0xDA);    // Set COM Pins hardware configuration
  Write_Command(0x12);
 
  Write_Command(0x81);    // Set Contrast Control
  Write_Command(0x7F);
 
  Write_Command(0xD5);      // Set Osc Frequency
  Write_Command(0x80);
  
  Write_Command(0x8D);      // Enable charge pump regulator
  Write_Command(0x14);
 
  Write_Command(0xD9);          // Set Pre-charge Period
  Write_Command(0xF1);
 
   Set_Addressing_Mode(0x02);
 
  Write_Command(0xA4);      // Disable Entire Display On
 
  Write_Command(0xA6);      // Set Normal Display
 
  Clear_Screen(0x00);
  
  Delay(0xFF);
  
}
void Clear_Screen (unsigned char Data)
{
        unsigned char i,j;
 
            for(i=0;i<8;i++)
            {
                Set_Start_Page(i);
                Set_Start_Column(0x00);
 
                for(j=0;j<128;j++)
                {
                    Write_Command(Data);
                }
            }
}
 
void Set_Cursor(unsigned char X,unsigned char Y)
{
    Write_Command(0x0F & 0x00);
    Write_Command(0x0F & 0x10+(X>>4));
    Write_Command(0xB0+Y);
}
 
void Draw_Pixel(unsigned char x_pos, unsigned char y_pos, unsigned char colour)\
{
    unsigned char value = 0x00;
    unsigned char page = 0x00;
    unsigned char bit_pos = 0x00;
    
    page = (y_pos / y_max);
    bit_pos = (y_pos - (page * y_max));
    value = buffer[((page * x_max) + x_pos)];
    
    if((colour & 0x01) != 0)
    {
        value |= (1 << bit_pos);
    }
    else
    {
        value &= (~(1 << bit_pos));
    }
    
    buffer[((page * x_max) + x_pos)] = value;
    OLED_gotoxy(x_pos, page);
    //Write_Command(value, DAT);
    Write_Command(value);
}



when i am try to clear dots on dispaly is not cleared
dots means whole display filled with dots

sir i should not understand how to do, i am trying mostly thats why i am asking ,
 

How are you attempting to plot and clear the dots at the main() function ?
 

Sir ,
I trying clear display ,its not clear is like the attached picture
_20150930_215635.JPG

Now I am trying to clear the display like above. That's my problem.how to clear and how to display
Code:
y cod like this

Code C - [expand]

void Init_Display(void)
{
    Dispaly();
    //Clear_Screen(0x00);
}
 
void Dispaly(void)
{
   
  RES=0;
  Delay(0xFFF); 
  RES=1;
  
  Delay(0xFF);
    
  Write_Command(0xAE);    // Turn Off Display Panel
 
  Write_Command(0xA8);    // Set MUX Ratio
  Write_Command(0x3F);
 
  Write_Command(0xD3);    // Set Display Offset
  Write_Command(0x00);
 
  Write_Command(0x40);    // Set DisplayStart Line
 
  Write_Command(0xA1);    // Set Segment re-map
 
  Write_Command(0xC0);    // Set COM Output Scan Direction
 
  Write_Command(0xDA);    // Set COM Pins hardware configuration
  Write_Command(0x12);
 
  Write_Command(0x81);    // Set Contrast Control
  Write_Command(0x7F);
 
  Write_Command(0xD5);      // Set Osc Frequency
  Write_Command(0x80);
  
  Write_Command(0x8D);      // Enable charge pump regulator
  Write_Command(0x14);
 
  Write_Command(0xD9);          // Set Pre-charge Period
  Write_Command(0xF1);
 
   Set_Addressing_Mode(0x02);
 
  Write_Command(0xA4);      // Disable Entire Display On
 
  Write_Command(0xA6);      // Set Normal Display
 
  Clear_Screen(0x00);
  
  Delay(0xFF);
  
}
void Clear_Screen (unsigned char Data)
{
        unsigned char i,j;
 
            for(i=0;i<8;i++)
            {
                Set_Start_Page(i);
                Set_Start_Column(0x00);
 
                for(j=0;j<128;j++)
                {
                    Write_Command(Data);
                }
            }
}

I wrote the code to clear like above but its look like above same
Help me how to clear how to display
 

You re-typed the same code posted before, still lacks the main() function that instantiate the functions above. We need to see how you're doing to call these routines.

By the way, the sequence of commands that you are using is a bit different from that suggested by the manufacturer, at the Application Note at page 64 of this document:
 

You don't show the actual code accessing the SSD1306 controller. There should be different functions to write command and data. I can't see it in your code.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top