SSD1963 with Due, cant get vertical scroll to work

Hi
Set up is Due , SSD1963 with 5 inch display using UTFT library

I am trying to scroll the display vertically and for a simple test I have loaded this bit of code. I have worked through the SSD1963 info and it all compiles
but all I get is the word 'scroll test' in the centre of the screen when I would have expected to see the image to scroll vertically at 20 line intervals

I have spent quite a lot of time on this and if anyone can spot the errors I have made that would be good.

Or even point me in the direction of finding some code which works.

Many thanks

Demo_scrolling.ino (1009 Bytes)

Go on. You are writing enormous decimal arguments and strange octal arguments.

I recommend that you use hexadecimal arguments or small decimals when appropriate.

Write the correct values and everything should work fine.

MCUFRIEND_kbv is designed for Uno Shields. It will drive an 8080-16 SSD1963 if you enable the SPECIAL macros. The standard graphictest_kbv example shows scrolling.

David.

OK thanks David

I cleaned it up as you suggest but it makes no apparent difference.

Anyway I will get the MCUFRIEND_kbv library you suggest and see if that works. I dont think the Adafruit supports Due but I might have misunderstood the info on their webpages

Bob

Your sketch was using the UTFT library. I would guess that you have your screen running all the examples on the Due.

Look at the SSD1963 datasheet. For scrolling to work, TOP+SCROLL+BOT must equal the scanlines. I seldom use the Due (or SSD1963). I am sure that it will work with UTFT.

Most controllers require a legal TFA+SCROLL+BFA. Some have a specific SCROLLEN bit e.g. Himax.

David.

Yes thats right. The Due and display work very well with examples and with the main programme I am working on at the moment. It would be best to be able to scroll in the display rather than holding the data in a buffer and doing the scroll manipulation there, quite apart from the memory implications.

I will do the checks you suggest. BTW should I toggle the CS line to the display do you think?

Thanks again
Bob

Having tried a few more of the commands in the SSD1963 such as invert text and blank display I conclude that instructions like
myGLCD.LCD_Write_COM(com1); where com1 is a char are compiled without error but in some way are not executed.

Ideas anyone?
Bob

Look at setXY.h and initlcd.h
A command requires the appropriate Chip Select to be valid.
You can do a long sequence of COM, DAT.. commands within a CS block.

I was bored. So I edited your program to run on an ILI9341 with a Uno. You must change the constructor for your SSD1963 and LINES value to 480:

#include <SPI.h>
#include <UTFT.h>

// Declare which fonts we will be using
extern uint8_t BigFont[];

// Uncomment the line for your display:
//UTFT myGLCD(TFT01_22SP,9,8,12,11,10);  // ElecFreaks TFT01-2.2SP
//UTFT myGLCD(TFT01_22SP,51, 52, 53, 8, 9);  // ElecFreaks TFT01-2.2SP
//UTFT myGLCD(MI0283QT9,11,13,7,8);        // Watterott MI0283QT9
UTFT myGLCD(ILI9341_S5P, 11, 13, 10, 8, 9);
//UTFT myGLCD(ILI9341_S5P,75,76,10,8,9);     //bit-bash on Due
//UTFT myGLCD(SSD1963_800,38,39,40,41);

const int LINES = 320;  //for my ILI9341
//const int LINES = 480;  //for your SSD1963

void setup()
{
    int scrollines = LINES;
    uint16_t TFA = 0, BFA = LINES - scrollines;
    myGLCD.InitLCD(0);  //Portrait for my ILI9341
    myGLCD.setFont(BigFont);
    // scroll frame
    cbi(myGLCD.P_CS, myGLCD.B_CS);
    myGLCD.LCD_Write_COM(0x33);
    myGLCD.LCD_Write_DATA(TFA >> 8); //TFA
    myGLCD.LCD_Write_DATA(TFA & 0xFF); //TFA
    myGLCD.LCD_Write_DATA(scrollines >> 8); //SCROLL AREA
    myGLCD.LCD_Write_DATA(scrollines & 0xFF);//
    myGLCD.LCD_Write_DATA(BFA >> 8);//BFA
    myGLCD.LCD_Write_DATA(BFA & 0xFF);
    sbi(myGLCD.P_CS, myGLCD.B_CS);

    myGLCD.clrScr();
}

void loop()
{
    myGLCD.print("scroll centre", CENTER, LINES / 2);
    delay(1000);

    for (int i = 0; i < LINES; i++) {
        cbi(myGLCD.P_CS, myGLCD.B_CS);
        myGLCD.LCD_Write_COM(0x37);
        myGLCD.LCD_Write_DATA(i >> 8);   //OFFSET
        myGLCD.LCD_Write_DATA(i & 0xFF); //
        sbi(myGLCD.P_CS, myGLCD.B_CS);
        delay(100);
    }
}

void WriteCmdParamN(uint16_t cmd, int8_t N, uint8_t *block)
{
    cbi(myGLCD.P_CS, myGLCD.B_CS);
    myGLCD.LCD_Write_COM(cmd);
    while (N-- > 0) {
        myGLCD.LCD_Write_DATA(*block++);
    }
    sbi(myGLCD.P_CS, myGLCD.B_CS);
}

Multi-argument commands are easier with a helper function.

David.

Very good I will give it a try

Thanks
Bob

Yes many thanks David
That scrolls in portrait very nicely.
I can use that as a model to sort out landscape etc

Bob

Problem fixed

The main issue was that in order to write to the SSD1963 using command and data lines like

myGLCD.LCD_Write_COM(0x33);
myGLCD.LCD_Write_DATA(TFA >> 8); //TFA
myGLCD.LCD_Write_DATA(TFA & 0xFF); //TFA

you need to enclose in

cbi(myGLCD.P_CS, myGLCD.B_CS);

above sort of code here and then

sbi(myGLCD.P_CS, myGLCD.B_CS);

Thanks
Bob

No, you can't. Vertical Scroll means just that. Your 800x480 screen can only scroll in the 480 direction.

Most controllers are Portrait e.g. ILI9341 is 240x320. Scrolls in 320 direction
Unusual ones are Landscape e.g. ILI9342 is 320x240. Scrolls in 240 direction.

If you are scrolling text, you are stuck with 800x480.
If you are scrolling a graph, you prefer horizontal scrolling e.g. 480x800

A few controllers can scroll in both directions e.g. RA8875.

David.

Thanks for the clarification, I was only commenting on the code you sent me which works in display portrait orientation and scrolls horizontally.

Bob

No, I have a comment in the setRotation() statement. UTFT defaults to initLCD(1) i.e. Landscape.
Different controllers have different geometry. They all scroll by manipulating GS (gatescan)

In practice, you scroll text vertically but scroll graphs and animations horizontally.

RoadRunner travels through the countryside with the "background" moving. Ok, the background "stops" when he falls off a cliff.

David.