NHD-0216CW-AB3 and an Arduino Micro

Comments

5 comments

  • The Fat Bastid

    Got it working.
    My first attempt I didn't use ports at all, got garbage output (used bitread to feed the data lines)
    Found a post on here that recommend nothing but port registers. Faster? ok sounds good.
    Finally remebered to try port register data and directwrite on everything else.
    and bam. perfect output now.

    0
  • Paul_B

    Glad to hear you are up and running!

    0
  • The Fat Bastid

    Oh, I forgot the 'why' part.
    The full timing cycle (tCYCLE) is 400ns.
     Port register manipulation is a lot faster than directwrite. (250ns vs 70042ns)
    So,it would need timing delays to get it work right.

    0
  • deeg92

    Can you send the code you added to get this working?

    0
  • The Fat Bastid

    The change is to the data and command functions:

    void command(unsigned char c){  //To send commands
      PORTB = c;                   //command on port
      digitalWrite(DC, LOW);
      latch();
    }

    void data(unsigned char d){    //To send data
      PORTB = d;                  //data on port
      digitalWrite(DC, HIGH);
      latch();
    }

    in my original code you can see that it was all port manipulation, now it is a combination of ports and digitalwrites

    0

Please sign in to leave a comment.