Eugeniuschang / u8glib

Automatically exported from code.google.com/p/u8glib
Other
0 stars 0 forks source link

unsupported lcd on avr. #244

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
hi i have wg12232a display, and i'm trying to interface it with atmel studio. 
the problem is that constructor doesn't work, and on supported devices on wiki 
there is n\a under avr.

i'm using this constructor:
U8GLIB_SBN1661_122X32 u8g(d0, d1, d2, d3, d4, d5, d6, d7, cs1, cs2, di, rw );

i know it's not supported, but is there any way to modify arduino library so it 
would work on avr?

Original issue reported on code.google.com by salko.ma...@gmail.com on 22 Mar 2014 at 11:04

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
BTW: This is code i'm using:

#define F_CPU 8000000UL

#include <avr/io.h>
#include <util/delay.h>
#include "u8g.h"

int main(void)
{
    while(1)
    {
        U8GLIB_SBN1661_122X32 u8g(d0, d1, d2, d3, d4, d5, d6, d7, cs1, cs2, di, rw );

        // picture loop
        u8g.firstPage();
        do {
            draw();
        } while( u8g.nextPage() );

        // rebuild the picture after some delay
        _delay_ms(1000);

    }
}

       void draw(void) {
           // graphic commands to redraw the complete screen should be placed here
           u8g.setFont(u8g_font_unifont);
           u8g.drawStr( 0, 20, "Hello World!");
       }

Original comment by salko.ma...@gmail.com on 22 Mar 2014 at 11:12

GoogleCodeExporter commented 8 years ago
it might work with the c interfrace:

Modify the aver examples and use u8g_Init8Bit:

uint8_t u8g_Init8Bit(&u8g, &u8g_dev_sbn1661_122x32, uint8_t d0, uint8_t d1, 
uint8_t d2, uint8_t d3, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t 
en, uint8_t cs1, uint8_t cs2, uint8_t di, uint8_t rw, uint8_t reset);

Original comment by olikr...@gmail.com on 22 Mar 2014 at 2:16

GoogleCodeExporter commented 8 years ago
thanks. it looks promising but one more thing how do i determine ports.

I know that PN(1,1) stands for port B pin 1 but i need to use port D,C or A 
because port B has all isp pins and they interfere with lcd. 

Original comment by salko.ma...@gmail.com on 22 Mar 2014 at 3:01

GoogleCodeExporter commented 8 years ago
he he. looks like i tried to use arduino syntax. sorry for confusion my bad, oh 
and the code worked ;D

Original comment by salko.ma...@gmail.com on 22 Mar 2014 at 6:56

GoogleCodeExporter commented 8 years ago
PN(3,1) is port D, pin 1, if this is still a question.

Original comment by olikr...@gmail.com on 22 Mar 2014 at 7:16

GoogleCodeExporter commented 8 years ago
closing...

Original comment by olikr...@gmail.com on 16 Jun 2014 at 7:09