Announcement

Collapse
No announcement yet.

Display as controller

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

  • Display as controller

    So far most of the examples I have found of serial communication assumes the display as under the control of another processor. In my application the display will be the hardware controller for a two-way radio via uart.

    The Magic Object in Genie Magic considers input from the serial port. Can the Magic Object be used to send data to a remote device from the display?

    Is there an example of sending formatted data to, and receiving a response from, a remote device in Genie Magic, via uart, using Pro features?

    Specific to this application, I need to send data to the radio and in some cases expect a response and process it. The commands are two letters followed by either a question mark or series of data depending on the function. The question mark elicits a response, data sets the parameter. (Command Reference)

    Is there any example showing how to do something like this in Genie Magic?

    As a test I would like to program a button that sends one specific command and displays the return. (any command ... toggle from SQ9 to SQ0 for example - then read the SQ...)

    Thanks for pointing me in the right direction.
    Last edited by Technicavolous; 19th August 2019, 03:33 AM.

  • #2
    Hello,

    Sounds like a very interesting project. 4DSystems Display Modules can be programmed as your master device controller.

    In my application the display will be the hardware controller for a two-way radio via uart.
    Have you decided which transceiver module you are going to use? If it is capable of UART communication
    there should be no problem 'talking' to the display module.

    The Magic Object in Genie Magic considers input from the serial port. Can the Magic Object be used to send data to a remote device from the display?
    This can be done by attaching a Magic Event on a button. For more information regarding Magic Events, please
    refer to this appnote:
    ViSi-Genie How to Add Magic Objects
    https://4dsystems.com.au/blog/4d-an-00182/

    ViSi-Genie Magic Code Insertion Points
    https://4dsystems.com.au/blog/4d-an-00199/

    Is there an example of sending formatted data to, and receiving a response from, a remote device in Genie Magic, via uart, using Pro features?
    You may refer to this thread on how to setup the serial connection between your module. You may have to put
    the code inside your Magic Code main loop to continuously fetch the data received from the module. (See 4D-AN-00199 for insertion points)

    I followed the Command Reference link and it leads to an error(The requested URL was not found on this server).

    I hope this information will give you some ideas.

    Good luck and best regards,
    Last edited by sherwin4D; 14th August 2019, 10:34 AM.

    Comment


    • #3
      Thank you for the insight.

      It is a nice little radio, you can find the information here -
      https://sites.google.com/site/hobbypcbrsuv3awiki/manual
      The command reference is there. Sorry for the broken link, I think I've fixed it.

      Thank you for the link to the Magic Events and the polling thread. This is my first foray into any kind of serial data so thanks in advance if I ask more questions ;] I will dig into this for a while and come back when I have intelligent ones.



      Comment


      • #4
        Seems I'm wrong in trying to learn serial with Visi-Genie. Straight Designer or Visi code appears best to figure it out.

        I've still not grasped communicating over serial. I got the encoder working (with help from AN-00063) but this is beating me. The example in AN-00072 is a bit too busy for me to understand the example. Also Codebase CD-00054 examples even I'm misunderstanding.

        Can you help me with hardware and minimum Designer / Visi code to

        a) help me select PA lines for com1 tx and rx
        b) help me figure which Gen4-PA GPIO pins relate to the PA lines
        c) minimum code to send data on com1 no response from device
        b) minimum code to send data on com1 and display response from device

        Sorry if I seem thick but eventually it will get through …
        Thanks

        Comment


        • #5
          Hi,

          The list of available PA lines for COMx RX and TX can be found at Diablo16 Internal Functions Manual(page 244-245).

          For example, if you want to use PA0 and PA1 for RX and TX, you could do:
          Code:
          COM1_RX_pin(PA0);
          COM1_TX_pin(PA1);
          
          com_SetBaud(COM1,960);
          
          gfx_Cls();
          txt_Set(FONT_SIZE, FONT2);
          
          to(COM1); print("serial input test:\n");
          Please refer to the gen4-PA datasheet for the correlation between gen4-PA GPIO to Diablo16 PA.
          Click image for larger version

Name:	image_3990.png
Views:	65
Size:	240.3 KB
ID:	69528
          As an example, if you wish you to use PA0 and PA1:
          PA0 ---> GPIO04
          PA1 ---> GPIO03

          I hope this helps.

          Good luck and best regards,
          Sherwin

          Comment


          • #6
            sherwin4D this is a most perfect example thank you!

            Comment

            Working...
            X