Announcement

Collapse
No announcement yet.

serial COM1 not working.

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

  • serial COM1 not working.

    Hi all,

    I am currently developing on the Gen4-35DTC-CLB, display with the Picaso processor. I am using the Visi IDE and the Gen4-PA board to get Rx1 and Tx1 pins.
    Based on what I saw in the GenP4 datasheet (https://www.mouser.com/ds/2/451/gen4...1_0-951988.pdf) I used GPIO14&15 for Rx1&Tx1.
    I precise that I am able to read bytes transmitted by the Display when I use COM0 in my code to ouput data (using Tx0 pin on Gen4 PA).
    Below is my code, maybe you will manage to see what is wrong...

    var status;
    var char;
    var combuf[32];

    //status := com_SetBaud(COM0, 960);
    status := com_SetBaud(COM1, 960);

    if (status)
    print(" Com set to 9600 ");
    endif
    //com_Mode(8,'N', 1, COM0);
    com_Mode(8,'N', 1, COM1);

    //com_Init(combuf, 32, 0);
    com1_Init(combuf1, 32, 0);

    while( 1 )
    pause(1000);
    serout1( 'a ' ); // send one byte
    //serout( 'a' ); // send one byte
    wend

    Best Regards.

    Thibaut

  • #2
    Hi Thibaut,

    Welcome to the forum!



    Unfortunately in Picaso, the com_Mode(...) function aren't found as Serial (UART) Communications Functions as discussed on Picaso Internal functions reference manual on page 163.


    As a result, I made some modification on your code.
    And here's the code as shown below:


    Code:
    func main()
    
    var status;
    var combuf[32];
    var combuf1[32];
    
    /*
    // COM0
    status := com_SetBaud(COM0, 960);
    com_Init(combuf, 32, 0);
    */
    
    // Uncomment the code below to enable the COM1 : Tx = GPIO 15 , RX = GPIO 14
    status := com_SetBaud(COM1, 960);
    com1_Init(combuf1, 32, 0);
    
    if (status)
        print(" Com set to 9600 ");
    endif
    
        repeat
            pause(1000);
    
            //serout('a'); // send one byte to COM0, Uncomment this to send data to COM0.
            serout1( 'a ' ); // send one byte to COM1, Uncomment this to send data to COM1.
    
        forever
    endfunc








    Please let me know if it works.

    Best regards,
    Kayven

    Comment


    • #3
      Hi Kayven.

      Thank you for your quick answer. Unfortunatly is did not solve the issue.
      Still working with COM0 though.

      Thibaut

      Comment


      • #4
        Hi Thibaut,



        Sorry for the inconvenience.



        Have you checked the connection between the external host and the display properly?

        It would be great if you can give me some photo of your hardware connection.



        And here is what it will look like that utilizing the display's COM1 (I have used Arduino Uno as my host) as shown below:

        Click image for larger version

Name:	aard to picaso-1.jpg
Views:	1
Size:	82.1 KB
ID:	66061
        GPIO15 as display's TX1 and GPIO14 as display's RX1.

        For Arduino: pin 4(RESET), pin3 (TX) and pin2(RX).



        For your references, I've attached the Arduino sketch and the ViSi Program that I used to demonstrate the serial communication of display's COM1.

        Also, I have also attached a simple video as a proof.




        Best regards,
        Kayven

        Comment


        • #5
          Thank you for the answer Kayven.

          I have used the program you gave to me as it is (just changing the platform to #platform "Gen4-uLCD-35DCT-CLB"), with the same result.
          On the picture I attached, you will see how I wired my Rs232 FTDI dongle. (Rx of the ftdi in yellow, wired on the Tx pin of the Gen4-PA).
          If I plug the yellow wire to the COM0 Tx, I managed to see bytes on my terminal.
          I have then tried with a different display (the Gen4-35DT) (also with different wires between the screen and the gen-4-PA) with the same result.
          I wanted to check the gen-4-PA by using the other interface board I have: the 4d-UPA (the one you see next to the gen4 on the picture) with the same result, so that is quite odd.

          Thibaut



          Attached Files

          Comment


          • #6
            Hi Thibaut,


            Thank you for sharing your photo.



            Based on the photo you gave, your display appears to be a Diablo16 processor?

            Please check it for me, if it is a Diablo16, not a Picaso processor.

            If it's a yes, in Diablo16, you will need to assign first, the RX and TX pins for the COM1.


            To do this by utilizing the commands, as shown below:

            Code:
            ....
            
            var status;
            var combuf[32];
            var combuf1[32];
            
            COM1_RX_pin(PA5);   // GPIO 9
            COM1_TX_pin(PA6);    // GPIO 8
            
            .....


            PA5 as RX1 and PA6 as TX1.

            PA14(GPIO15) is not available as discussed on the Diablo16 Internal Functions Reference Manual >> 2.11. Serial(UART) Comms Function >> 2.11.1. COM1_RX_pin(...) and 2.11.2. COM1_TX_pin(...).
            You may visit this manual by pressing F1 when doing your project.


            I have a attached the pin arrangement between the Gen4-PA and Diablo16.

            Click image for larger version  Name:	diablo pinouts.JPG Views:	1 Size:	86.9 KB ID:	66084

            There's an app note available for this can be found here: ViSi Data Loop Back Testing of Serial Hardware



            Hopefully, this will help you.

            Best regards,
            Kayven
            Last edited by kayven@4d; 21st November 2018, 02:31 PM.

            Comment


            • #7
              Hi,

              If your display is really a Picaso processor, there are things that we need to know first.

              Technically, PA12 and PA13 are reserved for the capacitive touch controller on the DCT-CLB model. These pins should not be connected else Touch performance may be degraded.
              There are 4.7k pull-up resistors on each of these GPIO. Avoid these pins in normal situations on this DCT-CLB model. Using these pins on non-touch(D/D-CLB) and resistive touch (DT) modules are.
              However OK, or in situations where touch is not required. These pins are 5V tolerant.

              I would suggest that you could use other available GPIO pins for COM1.

              Best regards,
              Kayven

              Comment


              • #8
                Oh my processor is the Diablo, not the Picaso, that was precisely my mistake, it is working fine now. I wonder why I persuaded myself it was the Picaso...
                Thanks a lot for your time.

                Thibaut

                Comment


                • #9
                  You're welcome! Thibaut.


                  If you have technical concerns, please don't hesitate to ask here.


                  All the best,
                  Kayven

                  Comment

                  Working...
                  X