On Fri, 23 Mar 2018, Peter C. Wallace wrote:

Date: Fri, 23 Mar 2018 07:14:38 -0700 (PDT)
From: Peter C. Wallace <p...@mesanet.com>
Reply-To: EMC developers <emc-developers@lists.sourceforge.net>
To: EMC developers <emc-developers@lists.sourceforge.net>
Subject: Re: [Emc-developers] writing new firmware to read yaskawa absolute
    encoder

On Fri, 23 Mar 2018, Th?ng L? wrote:

Date: Fri, 23 Mar 2018 16:04:47 +0700
From: "[UTF-8] Th?ng L?" <lethang12...@gmail.com>
Reply-To: EMC developers <emc-developers@lists.sourceforge.net>
To: EMC developers <emc-developers@lists.sourceforge.net>
Subject: Re: [Emc-developers] writing new firmware to read yaskawa absolute
    encoder

i guess i cant contact UART on mesa 5i25 by linuxcnc, just only can get
data from FIFO. I found a way to solve this problem without touchich uart.c
source but it's not complete.

in 8 bytes serial, the first data is "P" (80 in hexa) and last bytes is
"CR" (13 in hexa).

if i read FIFO data every 1 ms ( speed to read 1 bytes at 9600 baudrate and
10 bit frames), function will stop reading when it sees 80 ( or 13) but i
get only 1 byte that is 80 (or 13). I guess RX FIFO is cleared everytime i
read but i didnt find where that function is in:


When you start looking for the serial data do you clear the FIFO first?
(writing to the FIFO count register clears the FIFO)

Does the low level read function wait for data? (FIFO count not 0)

If you dont do these things its not likely you will get usable data


Also you should read _all_ characters in the FIFO every ms
(meaning you must read the FIFO count first to determine how many to read)

Peter Wallace
Mesa Electronics


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to