Announcement

Collapse
No announcement yet.

UART not working

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

  • UART not working

    hi,
    my GUI is ready now , time to interface controller using Designer Environment.
    i tried some example for UART communication but there is nothing terminal.
    simply used FTDI232 to display data on my putty terminal. but there is noting. below is the code,
    Code:
    #platform "uLCD-70DT"
    
    
    #inherit "4DGL_16bitColours.fnc"
    var mybuf:="sample";
    
    func main()
    
        gfx_ScreenMode(LANDSCAPE) ; // change manually if orientation change
    
         print("Hello World") ;      // replace with your code
        COM1_RX_pin(PA7);
        COM1_TX_pin(PA6);
        com_SetBaud(COM1, 9600);
        com_Mode(8,'N', 1, COM1); //declare communication mode
        repeat                      // maybe replace
        serout('Y');
        forever                     // this as well
    
    endfunc
    
    ​​​​​​
    i dont think there is something left in configuration of UART.
    help me out
    thanking you.

  • #2
    Hi,

    Could you please try this code.

    Code:
    #platform "uLCD-70DT"
    
    
    #inherit "4DGL_16bitColours.fnc"
    var mybuf:="sample";
    var rxbuf[50];
    
    func main()
    
        gfx_ScreenMode(LANDSCAPE) ; // change manually if orientation change
    
         print("Hello World") ;      // replace with your code
        COM1_RX_pin(PA7);
        COM1_TX_pin(PA6);
        com_SetBaud(COM1, 9600);
        com_Mode(8,'N', 1, COM1); //declare communication mode
        com1_Init(rxbuf, 100, 0);
        repeat                      // maybe replace
        serout('Y');
        pause(100);
        forever                     // this as well
    
    endfunc
    If it still doesn't work, you could try swapping Tx & Rx around. If possible could you send me an image of your setup.

    Best regards

    Paul

    Comment


    • ykn
      ykn commented
      Editing a comment
      no, not working, swapping done.
      i thought it might be the problem of ftdi232 so i change to picoscope .
      and there is nothing on scope.

  • #3
    Originally posted by pauleilio View Post
    Hi,

    Could you please try this code.

    Code:
    #platform "uLCD-70DT"
    
    
    #inherit "4DGL_16bitColours.fnc"
    var mybuf:="sample";
    var rxbuf[50];
    
    func main()
    
    gfx_ScreenMode(LANDSCAPE) ; // change manually if orientation change
    
    print("Hello World") ; // replace with your code
    COM1_RX_pin(PA7);
    COM1_TX_pin(PA6);
    com_SetBaud(COM1, 9600);
    com_Mode(8,'N', 1, COM1); //declare communication mode
    com1_Init(rxbuf, 100, 0);
    repeat // maybe replace
    serout('Y');
    pause(100);
    forever // this as well
    
    endfunc
    If it still doesn't work, you could try swapping Tx & Rx around. If possible could you send me an image of your setup.

    Best regards

    Paul
    serout1('Y');
    it should be like this , now i am getting some value on scope
    thanking you

    Comment


    • #4
      Originally posted by ykn View Post

      serout1('Y');
      it should be like this , now i am getting some value on scope
      thanking you
      Yes, Sorry I didn't notice that, Glad it's working now

      Comment

      Working...
      X