14 Replies Latest reply on May 11, 2016 5:01 PM by JPMontero_Intel

    How to use UART_B as a RS485

    Prityaa

      I would like to use  UART_A as a debugging port and the UART_B as a RS485.

        • 1. Re: How to use UART_B as a RS485
          JPMontero_Intel

          Hi Prityaa,

           

          If you are using the Intel Quark Microcontroller D2000 Development Platform this cannot be done because of the way the board is wired. If you check the board’s schematics you’ll see that UART_B is connected to the FTDI chip which is the one used for debugging.

           

          Regards,

          JPMontero_Intel

          • 2. Re: How to use UART_B as a RS485
            Prityaa

            you mean, we can use it for only rs232,

            Is there any option to get my goal ....??

            Is it possible for UART A ....??? if  yes, how can do it .... what configurations I will have to do ....???         

            • 3. Re: How to use UART_B as a RS485
              JPMontero_Intel

              Hi @Prityaa,

               

              The Intel Quark D2000 Microcontroller does support RS-485, but we will investigate on how to use it with the Quark D2000 Dev Kit. We will reply back as soon as we have more information on this.

               

              Regards,
              JPMontero_Intel   

              • 4. Re: How to use UART_B as a RS485
                Prityaa

                Thanks for your help.

                I am receiving the data from other device which has baud rate of 9600,  to UART A. But it seems that I have slow receive rate. Is there any way to make the it faster.

                I have some issues in transmitting data as well. All byte I am not able to transmit. At receiver site, I am able receive all the bytes.

                • 5. Re: How to use UART_B as a RS485
                  JPMontero_Intel

                  Hi Prityaa,

                   

                  In order to use RS485 you need to connect a differential driver to the Quark D2000 Dev Kit. More information regarding the usage of the RS485 can be found in the Intel Quark D2000 microcontroller Datasheet, in sections 2.2 External Interface Signals, 3.3 Pin Multiplexing, 14 UART and 14.3 Memory Mapped IO Registers. Also please be careful about the voltage levels for RS485 using the Quark D2000 Dev Kit and the differential driver to avoid any damage to the board.

                   

                  About UART_A speed, could you please share the code you are using to read the data?

                   

                  Regards,
                  JPMontero_Intel

                  • 6. Re: How to use UART_B as a RS485
                    Prityaa

                    Thanks for your consideration.

                     

                    I have connected the deferential driver as you suggested. I am using the same code flow as given in UART demo code.

                    1 . I have an issue in transmitting data as well. The receiver is getting only byte out of 8 as shown in image.

                    Here we are trying to communicate via atmel processor RS485 to intell controller RS-232 by differential driver interface.

                    Brown terminal  --> receiver-processor end

                    white terminal  --> controller-controller end

                     

                    transmit_error.png

                    2 . In receiving, I am getting partial characters, not whole string.Some characters are missing regularly.

                    receive_issue.png

                    3 . source code is attached for reference .

                    Can somebody help me to sort out this issue.

                    Thanks.

                    • 7. Re: How to use UART_B as a RS485
                      JPMontero_Intel

                      Let us run some tests to see if we can replicate this. We will reply back as soon as we get more information.

                       

                      Regards,

                      JPMontero_Intel

                      • 8. Re: How to use UART_B as a RS485
                        Prityaa

                        One more thing, I would like to ask you that sheet has mentioned regarding the RS-232 and RS-485 modes.

                        Where we can set these modes .

                        • 9. Re: How to use UART_B as a RS485
                          JPMontero_Intel

                          Hi Prityaa,

                           

                          Let us double check this as well. We will let you know about our results and the UART modes soon.

                           

                          Regards,
                          JPMontero_Intel

                          • 10. Re: How to use UART_B as a RS485
                            Prityaa

                            We are getting error while receiving data ..... where this error is coming from ...???  What makes it to decide error on that port ...???

                            • 11. Re: How to use UART_B as a RS485
                              JPMontero_Intel

                              Could you please share a screenshot of the error? When is this error occurring, as soon as you start using the UART?

                               

                              Regards,
                              JPMontero_Intel

                              • 12. Re: How to use UART_B as a RS485
                                JPMontero_Intel

                                The UART in the D2000 has two extra pins that add extra functionalities such as CTS and RTS that are used in RS232 but in fact can be used to enable and disable the differential transmitter and emitter respectively in RS485.

                                 

                                In the code you shared the UART is initialized as follow:

                                void UART_mux(qm_pin_id_t TX_pin , qm_pin_id_t RX_pin, qm_pmux_fn_t fun)
                                 {
                                      qm_pmux_select(TX_pin, fun);
                                      qm_pmux_select(RX_pin, fun );
                                      qm_pmux_input_en(RX_pin, true);
                                 }
                                

                                 

                                And to be able to use CTS and RTS you need to add the following lines (this example uses the UART_A pins):

                                 

                                /* RTS , CTS pins */
                                 qm_pmux_select(QM_PIN_ID_14, QM_PMUX_FN_2);
                                 qm_pmux_select(QM_PIN_ID_15, QM_PMUX_FN_2);
                                

                                 

                                The code would look like the following:

                                void UART_mux(qm_pin_id_t TX_pin , qm_pin_id_t RX_pin, qm_pmux_fn_t fun)
                                {
                                      qm_pmux_select(TX_pin, fun);
                                      qm_pmux_select(RX_pin, fun );
                                      qm_pmux_input_en(RX_pin, true);
                                /* RTS , CTS pins */
                                     qm_pmux_select(QM_PIN_ID_14, QM_PMUX_FN_2); /* Pins are J23_3 and J23_4 in the CRB
                                      qm_pmux_select(QM_PIN_ID_15, QM_PMUX_FN_2);
                                 }
                                

                                 

                                Please try with these changes and let us know if this works. Also, could you please share the schematics of the connection you are using so we can review it?

                                 

                                Regards,
                                JPMontero_Intel

                                • 13. Re: How to use UART_B as a RS485
                                  Prityaa

                                  Thanks for your co-ordination.

                                   

                                  I was out of the station. Sorry  for reply after long time.

                                   

                                  Sir, I studied some code for other boards. And I observed that we are missing many things that are to be configured.

                                  like after Reading and writing from and to buffer, we need to clear the Reading register.

                                  And regarding the receiving the junk values, do we need to set fractional divider also ?

                                   

                                  Don't we have any sample code so that we can do the exact configuration as per our requirement.. ?

                                  • 14. Re: How to use UART_B as a RS485
                                    JPMontero_Intel

                                    I suggest you to check the commands you can use with UART and a description on the usage by accessing the documents that are located in IntelSWTools/ISSM_2016.0.027/firmware/bsp/1.0/doc/html/modules.html

                                     

                                    Regarding the sample codes, currently the only example for using UART is in the folder ISSM_2016.0.0.127/firmware/bsp/1.0/examples/uart/main.c.

                                     

                                    Have you already tried with the configuration we suggested above? If so, what was the result?

                                     

                                    Also, don’t forget to send us the schematic of your current connection.

                                     

                                    Regards,

                                    JPMontero_Intel