Announcement

Collapse
No announcement yet.

PROBLEMS WITH SERIAL COMMUNICATION with GEN4-uLCD-35DT

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

  • PROBLEMS WITH SERIAL COMMUNICATION with GEN4-uLCD-35DT

    Hi Everyone,

    Now i'm doing a project with GEN4-uLCD-35DT and ViSi Environment.
    My current project is the same as the one I did before, so I copied the code and re-designed the graphics by enlarging the icons, widgets etc...

    For my previous project I used the GEN4-uLCD-24PT, which worked with the Picaso processor and now I am working with the Diablo.
    Now I'm having problems with serial communication. In the Diablo there is no "Bus_Set" function that was present in the Picaso instead.
    In my previous project I inserted this function at the beginning of the main func: bus_Set(0x00)

    My question is:
    - How do I use the same function with the Diablo?

    I have see that there is a function named bus_SetPins(value) in the Diablo but i don't know if i have to use it for my purpose.

    I tell you that the pins I have to control as RX and TX are the following:
    RX: PA12 (pin 31 of Diablo processor)
    TX: PA13 (pin 32 of Diablo processor)


    Thank you,
    Daniele
    Last edited by Daniele Utec; 24 January 2020, 10:47 PM.

  • #2
    Hi Daniele,

    Referring to the datasheet -
    bus_SetPins() -> "Any '1' bits in "value" sets the corresponding port pin to an output and forces its state to a '1'."
    "A value (usually a constant) specifying the pin number. Bit 0 corresponds to PA0 through to bit9 which corresponds to PA9."

    There is also an example given, this should give you an idea on how it works:

    var arg1;
    arg1 := 0b0011010 // set desired mask
    bus_SetPins(arg1); // set PA1, PA3 and PA4 to output, making them HI


    However, I am confused when you mentioned serial communication. If you want to use PA12 and PA13 as COM ports, then you only need to specify these pins as RX and TX. Please refer to the Section 2.11 Serial(UART) Communications Functions

    Code:
    COM1_RX_pin(PA12);
    COM1_TX_pin(PA13);
    I hope this helps.

    Best Regards,
    Kevin

    Comment


    • Daniele Utec
      Daniele Utec commented
      Editing a comment
      Hi Kevin,

      Thank you for the tips.
      I didn't know there was also this functions to set the RX and TX port for communication.
      Now I've solved my problem.
      I couldn't find a solution.


      Thank you,
      Daniele

    • John Kevin
      John Kevin commented
      Editing a comment
      Hi Daniele,

      Sure, no problem. I am glad you managed to sort it out.

      Best Regards,
      Kevin
Working...
X