Author Topic: serial port  (Read 12145 times)

Offline Itche

  • Newbie
  • *
  • Posts: 10
    • View Profile
serial port
« on: September 23, 2008, 07:00:22 PM »
Hello all,
What do I need to redefine in order to use the RS232 com port instaed of the Debug port on the eval board?

Thanks
Itche

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: serial port
« Reply #1 on: September 23, 2008, 07:43:06 PM »
Hi Itche

The AT91SAM7X-EK board has 2 DSUB connectors.
One is connected to UART0 and the other to the debug interface. The project defines by default the use of UART0 (in app_hw_sam7x.h):
    #define DEMO_UART        0                                           // use UART 0

UART1 is not connected to a DSUB connector (and has no RS232 level shifters) so is only available on the development connector - use this instead of UART0 simply change DEMO_UART to 1.

I think that your question is may be inverted since the debug port is not supported in the project,so presently is not used (it can be used for downloading new code as you probably know, which is controlled by the boot code in the chip). To be able to use the debug interface as serial port it will be necessary to add a driver to support it in SAM7X.c (it is a little different to the main UARTs if I remember correctly).
Is this what you would like to do?

Regards

Mark


Offline Itche

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: serial port
« Reply #2 on: September 24, 2008, 04:06:49 PM »
Mark,
as usual, thanks for the quick response.
You are right, I mixed between the two.
My Atmel board is the AT91SAM7X-EK (it does not have a REV version on it). As you mentioned there are 2 DSUB's on it but in my case BOTH are connected and the DEBUG one has the same ADM3203 that is installed for the RS232 connector driving it. I have verified that it is connected to the SAM (pins 73, 74) chip and that it is connected in parallel with the relevant pins on J16A (28,29).

On my board (which is based on the Atmel board) I have connected 2 DSUBs as well.
The first one is connected to PA0 and PA1 same way it is on the Atmel board and this connection work Ok with the default configuration of Demo_Uart to be 0. (RS232)
The second one is connected to PA27 and PA28. When I change Demo_Uart to be 1 (I did this before posting the issue), I assumed this connector will work, however it is not. It is also not working on the Atmel board DEBUG DSUB or on J16
Thanks in advance
Itche

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: serial port
« Reply #3 on: September 24, 2008, 08:40:19 PM »
Itche

I still think that this is normal.
If you define the demo UART to be UART1 it will use PA5 and PA6 for RXD1/TXD1 (pins 89 and 90).
These are not connected to the ADM3202s and the only way that you can test is by adding a driver to the communication lines (J16 A6 / A7).

I have noted the fact that the debug UART is not presently supported (it will be UART 2 on the board) and hope to be able to give an update for this in the near future.

Regards

Mark

Offline Itche

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: serial port
« Reply #4 on: September 25, 2008, 04:02:42 PM »
Mark,
you are the best.
Thanks for your time and help.
I'm going to modify my design in such way that the Debug port wont be "visible" to the outside world and re rout Uart 0 to that location.
Again, thanks so much
Itche

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: serial port
« Reply #5 on: October 16, 2008, 12:22:56 AM »
Hi All

Please note that I have added DBG UART support to the development version of the SAM7X project. It works in interrupt and DMA modes in much the same way as the USARTs. The only (HW) restriction is that it only supports 8 bit characters.

To use the DBG UART as serial interface it is opened as port 2 (USARTs  are opened as 0 and 1).

This will be included in the next service pack. Presently I am trying to complete the USB device driver for the SAM7X so that it will do the same as the present M5223X project (virtual COM and firmware upload via USB).

Regards

Mark