Announcement

Collapse
No announcement yet.

Reading the ACK

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reading the ACK

    I'm trying to read the ACK from my uVGA-II SGC. The card is supposed to provide a 06(hex) ACK byte if successful, or a 15(hex) NAK byte if unsuccessful.
    I have not been able to reliably read that byte (I sometimes get other results other than the 06 or 15), and it's clobbering my output.


    HTML Code:
    vgaBaud(7); //set to 14400
    
    int vgaBaud(int z){
    Serial3.print(byte(81)); //command
    Serial3.print(byte(z)); //baud
    if (GetResponse() == 6)
    
    {
    
    GetResponse();
    
    }
    }
    
    
    byte GetResponse()
    {
    
    
    while (Serial3.available()) {
    // read the incoming byte:
    incomingByte = Serial3.read();
    
    // say what you got:
    Serial.print("I received: ");
    Serial.println(incomingByte, HEX);
    return incomingByte;
    }
    }
    Steve Spence KK4HFJ
    http://arduinotronics.blogspot.com

  • #2


    How are you powering it up? The most obvious thing I can think of is not enough current or voltage supplied to the module. Also check the noise levels on the supply line.
    Atilla

    Comment


    • #3


      Seeing as I have text and background color on the screen, I don't think that's the issue. I'm having to put 125 ms delays after each command otherwise they don't take. It's really slowing the program. I thought that I could just wait for the ack, and then continue on, but no ack ever comes.

      The module is picking up +5vdc from the arduino 2560 +5 pin.

      Are you saying my code is correct?
      Steve Spence KK4HFJ
      http://arduinotronics.blogspot.com

      Comment


      • #4


        Our tech support staff will be back from holidays next week, unfortunately I'm not going to be much more help, unless there are other forum members who are familiar with the arduino platform. In the mean time take a look here, there's a full arduino library for the uLCD-32PT(SGC), it should work with the uVGA-II(SGC): https://sites.google.com/site/vilorei/arduino/13--serial-touch-320x240-lcd-screen
        Atilla

        Comment


        • #5


          I've tried that library, but it does not compile for me. I've been in contact with the author. We will keep trying. He wants the libraries in the same folder as the .pde, which is not where they are supposed to be located. There is a great lack of working examples for simple things like displaying text or drawing rectangles. I suggest 4D post some simple working sketches on their site in a tutorial section.
          Steve Spence KK4HFJ
          http://arduinotronics.blogspot.com

          Comment


          • #6
            Ok, I have the Ack working. This sketch gives me confirmation in the serial monitor:

            Code:
            void setup() {Serial.begin(19200);Serial3.begin(9600);Serial.print("\n\n\n***\n");Serial.print("init \t");Serial3.print('U'); // connectwhile (!Serial3.available());Serial.print(Serial3.read(), HEX);Serial.print("\n---");}void loop() {}
            Steve Spence KK4HFJ
            http://arduinotronics.blogspot.com

            Comment


            • #7


              What's with the smiley faces in my code above?
              Steve Spence KK4HFJ
              http://arduinotronics.blogspot.com

              Comment

              Working...
              X