This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USART Driver used as SPI

Hi,

I'd like to use USART0 of my ATSAME70Q21 as SPI master but It does not work.

I'm using CMSIS driver (Keil). If I use UASRT as UART it works well.

The setting for SPI master is this:

case USART_0:
   Usart[Ch].pDrv->Initialize( Usart0Callback );
   Usart[Ch].pDrv->PowerControl( ARM_POWER_FULL );
   Usart[Ch].pDrv->Control( ARM_USART_MODE_SYNCHRONOUS_MASTER | ARM_USART_CPOL0 | ARM_USART_CPHA0 | ARM_USART_DATA_BITS_8, BaudRate );

   Usart[Ch].pDrv->Control( ARM_USART_SET_DEFAULT_TX_VALUE, 0xFFFF );

   Usart[Ch].pDrv->Control( ARM_USART_CONTROL_TX, 1 );
   Usart[Ch].pDrv->Control( ARM_USART_CONTROL_RX, 1 );
   break;

  while(1)

     Usart[Ch].pDrv->Send( pData, Size );

Best regards

LB

Parents
  • Hi Milorad,

    I have contacted Microchip, no solution for CMSIS driver.

    I have definitive hardware I can note change nothing.

    In this hardware I have 3 different MCUs and I want use CMSIS driver for all

    If Keil offers CMISS driver I expect that are all ok (Costumer that has payed the license).

    I think the best way is a workaround about your driver as soon as possible.

    Best regards

    LB

Reply
  • Hi Milorad,

    I have contacted Microchip, no solution for CMSIS driver.

    I have definitive hardware I can note change nothing.

    In this hardware I have 3 different MCUs and I want use CMSIS driver for all

    If Keil offers CMISS driver I expect that are all ok (Costumer that has payed the license).

    I think the best way is a workaround about your driver as soon as possible.

    Best regards

    LB

Children
  • Hi LB,

    well, actually, license is for the tool (IDE + Assembler/Compiler/Linker or also Middleware) and CMSIS drivers are just an attempt from Keil to standardize API across multiple MCUs and Vendors to allow better adoption of the MCUs and easier and faster software development.

    The license does not guarantee you have latest support for any MCU nor that CMSIS drivers are available for your MCU.

    Main motivator for CMSIS driver implementation is MCU's popularity on the market.

    Best regards, Milorad

  • Hi Milorad,

    I think a workaroud is necessay in front of a macro problem as this: no work completely the SPI and the UART work well in TX ISR but when I receive bytes during tx the driver goes in error.

    Best regards

    Luca Bernabei

  • Hi Luca,

    I'd suggest you dig into the driver and fix the things that are not working for you since a lot of functionality is already available.
    It is, however, not as easy as it sounds as implementing drivers or debugging them is always time consuming.

    Good luck!

    Best regards, Milorad