Community
cancel
Showing results for 
Search instead for 
Did you mean: 
PSuta
Beginner
1,355 Views

How to use UART_B as a RS485

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

0 Kudos
14 Replies
Juan_M_Intel
Employee
66 Views

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 http://www.intel.com/content/www/us/en/embedded/products/quark/mcu/d2000/quark-d2000-crb-schematics.... schematics you'll see that UART_B is connected to the FTDI chip which is the one used for debugging.

Regards,

JPMontero_Intel

PSuta
Beginner
66 Views

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 ....???

 

Juan_M_Intel
Employee
66 Views

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
PSuta
Beginner
66 Views

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.

Juan_M_Intel
Employee
66 Views

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 http://www.intel.com/content/www/us/en/embedded/products/quark/mcu/d2000/quark-d2000-datasheet.html 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
PSuta
Beginner
66 Views

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

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

3 . source code is attached for reference .

Can somebody help me to sort out this issue.

Thanks.

Juan_M_Intel
Employee
66 Views

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

PSuta
Beginner
66 Views

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 .

Juan_M_Intel
Employee
66 Views

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
PSuta
Beginner
66 Views

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

Juan_M_Intel
Employee
66 Views

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
Juan_M_Intel
Employee
66 Views

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
PSuta
Beginner
66 Views

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.. ?

Juan_M_Intel
Employee
66 Views

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