This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OMAP-L138/C6748 LC Dev Kit - SPI0 And Ethernet RMII channels

Other Parts Discussed in Thread: OMAP-L138, TMS320C6748

Hello,

I develop on OMAP-L138/C6748 LC Dev Kit.

Can I use Ethernet RMII interface channel?

Can I use SPI0 and Ethernet (RMII interface) channels simultaneously?

Can I use UARTs and Ethernet channels simultaneously?

Sincerely,

Yacob Hassidim.

  • Hi Yacob,

    In C6748 LC Dev Kit, Ethernet PHY chip LAN8710A-EZK is connected to MII interface of processor.
    So you can not use the RMII interface in this board. But the processor supports both MII and
    RMII mode.

    The below link provides the Pin Mux utility and using this, you can find out the Pin Mux conflicts.


    http://www.ti.com/dsp/docs/litabsmultiplefilelist.tsp?sectionId=3&tabId=409&literatureNumber=sprab63b&docCategoryId=1&familyId=1622

    Please refer the schematics and you can get that which pin is connected to device.

    Regards,
    Balaji N

  • Hello Balaji,

    Do you mean I can not use SPI channel in C6748 LC Dev Kit?

    Can I use UARTs and Ethernet channels simultaneously?

    Sincerely,

    Yacob Hassidim.

     

  • Hi Yacob,

    In C6748 processor, SPI0, UART0 and MII Ethernet are sharing pins.
    So in C6748 LC Dev Kit, you can use any one of the above componenet at a time.

    Please check for the other SPI and UART devices.

    -Regards,
    Balaji N

  • Hello Balaji,

    I use PSP/BIOS operating system.

    Can I use C6748 LC Dev Kit hardware as is in order to use SPI0 or I must change hardware e.g. put resistors?

    Can I use PSP/BIOS operating system and SPI0 channel in  C6748 LC Dev Kit?

    Can I use SPI0 and Ethernet channels not simultaneously on the same software but changing the pin mux only without reset the system?

    I mean to perform the following steps without reset of the system:

    a) to use SPI0 to communicate to one device and save the data in RAM

    b) change the pin mux to Ethernet

    c) transfer the data to another device via Ethernet

    Sincerely,

    Yacob.

     

  • Hi Yacob,

    In C6748 LC Dev kit, You can use SPI0 by putting resistors R214 to R219 and removing the resistors
    R172 to R179. I am referring the shematics of C6748 LCDK Ver A5 board. Please check your board's
    schematics and find out the resistors.

    Please refer the Ethernet PHY page in schematics. But at a time i.e. in this board, you can not use both SPI0
    and Ethernet device. Since each transaction (SPI transaction and Ethernet transaction) SPI device and Ethernet PHY
    will get the data (If the resistors R172 to R179 are not removed).
    I am not sure that for each data (SPI data and Ethernet data) how the devices will respond.

    Regards,
    Balaji N

  • Hello Balaji,

    Thank you for your answer.

    The Ethernet PHY (LAN8710A) permits to power down or isolate the transceiver.

    Can I perform the following steps (after hardware changes and without reseting of C6748 Dev kit)?

    1) Isolate (or power down) the Ethernet transceiver

    2) Set up the pin mux to SPI0

    3) Communicate to a SPI device

    4) Stop isolate mode of the Ethernet transceiver

    5) Set up the pin mux to Ethernet

    6) Communicate to Ethernet system

    Sincerely,

    Yacob Hassidim.

  • Hi Yacob,

    In C6748 LC Dev kit, You can use both SPI0 and MII Ethernet.

    Need to mount the resistors for SPI0 pins and SPI0_Ena should be supported
    by your device. Otherwise, can not use both SPI0 and MII Ethernet at a time.

    The pin details:


    Ethernet pins RX_DV     RXD3     RXD2
    SPI pins     SPI0_Ena SPI0_CS5     SPI0_CS4

    It has 2 test cases:

    In Ethernet,
                       RX_DV     RXD3         RXD2        SPI Device
    By default,    Low         High          High         will not respond, since SPI0 CS will be high.
    When data
    arrives          High        Any state   Any state    will not respond, since SPI0_Ena is not valid.
                                                                         it will not accept the data.
    In SPI,   
                              SPI0_Ena   SPI0_CS5     SPI0_CS4    Ethernet Device
    By default             Low           High              High          Processor will not receive the data.                            
    When transaction  Low           Low               Low           Rx_DV low.

    You can try this configuration in one board.

    Regards,
    Balaji N



  • Hello Balaji,

    Thank you very much for your answer.

    Can you please be particular and advise me:

    a) What hardware changes I should perform: e.g. putting resistors R214 to R219 (which value) and removing the resistors R172 to R179 or part of them is enough?

    b) The software steps I should perform: e.g.

         b.1) isolate Ethernet device in order to use SPI device (receive and transmit), and/or

         b.2) disable SPI devise (setting of SPI0_CS4 and SPI0_CS5 in high as GPIO pins) in order to use Ethernet device or

         b.3) nothing: just transmit/receive Ethernet and SPI0 at a time

    I posted a question in BIOS forum (http://e2e.ti.com/support/embedded/bios/f/355/p/235030/826021.aspx#826021). I didn't receive a reply from 20 Dec. Can you please help me to receive a reply?

    Thank you again for your support.

    Sincerely,

    Yacob Hassidim.

     

  • Hi Yacob,

    a) Please put the resistors in R214 to R219 and keep the resistor from R172 to R179.
       So that both devices are ready for communication.

    b.1) Isolate the Ethernet device and change the Pin Mux settings to SPI Bus.

    b.2) No need to disable the CS pins and these pins will be used by Ethernet PHY.
         Connect the SPI0_Ena to SPI device. When SPI0_Ena is low, then no data from
         Ethernet. When SPI0_Ena high, SPI device will not get the data.

    -Regards,
    Balaji N

  • Hello Balaji,

    Thank you for your answer.

    a) Do you mean the same resistors that I remove from R172 to R179 put on R214 to R219?

    Sincerely,

    Yacob Hassidim.

     

  • Hello Balaji,

    I left R172 to R179 and put short wire in place of of R214 to R219.

    I succeeded to communicate with Ethernet device completely and SPI device only from DSP to the device.

    The SPI device (slave) identifies the DSP (master) command and transmits the desired response.

    I see the SPI device response on Scope.

    While the SPI device output pin is not connected to DSP input (SPI0_SOMI) the output pulses act correctly between 0 to 3.3 volt.

    But while the SPI device output pin is connected to DSP input (SPI0_SOMI) the output pulse are between 3.3 volt to 3 volt.

    In accordance to TMS320C6748 DSP technical reference manual (spruh79a) SPI0_SOMI is in high impedance state.

    The voltage of SPI0_SOMI is 3.3 volt while it is disconnected.

    Can you please advise me what should I do in order the pulse will act correclty (between 0 to 3.3 volt)?

    Sincerely,

    Yacob Hassidim.

     

  • Hello Balaji,

    I am waiting for your answer.

    I appreciate your help.

    Sincerely,

    Yacob Hassidim.

     

     

  • Hello Yacob,

    I am affraid, I am not able to answer your questions. I have some questions on you.

    I have C6748 LCDK v.A5 (with finger print sensor). I need to establish DSP - slave device connection via SPI.

    You have suceed, so you could give me some tips.

    I use connector J15 and signals SPIO_CLK and SPIO_SIMO.

    I have short-wired R214-19.

    I wrote programm to manage SPIO connection, but when I display the SPIO_CLK signal on Scope, it was always hig (3V3), slightly modulated with harmonic signal of frequency cca 25MHz. The frequency setting changes of SPI0_CLK in programm doesn´t effect the signal frequency on the Scope.

    Did you have the same problem? How have you solved it? Did you need to power down the LAN8710A-EZK?

    Thanks for your answers.

    Petr Duga

  • Hello Petr,

    I worked with this board about six month ago so I don't remeber so much.

    I powered down the Ethernet component of the board and power up the SPI component.

    I used the example of SPI from other development kit of  TMS320C6748 that SPI driver was not multiplexed with Ethernet.

    I don't suggest you to use LCDK for SPI communication!

    Sincerely,

    Yacob Hassidim.

     

  • Hello Yacob,

    Thanks for your answer.

    I need to use SPI, because I need to set up a functional generator, that communicates via SPI.

    I have powered up SPI, but I have problem to power down the ethernet component, could you help me with it?

    Could I do it using psc?

    I have found, that for general power-down I will need to set following bits:

    BasicControlRegister.Auto-NegotiationEnable=0;

    BasicControlRegister.PowerDown=1;

    But I don´t know how to write to them.

    Thanks for your answer

    Petr Duga

  • Hello Petr,

    Attached please find the module 'network' that I developed to shutdown and power up the Ethernet device.

    Sincerely,

    Yacob Hassidim.

    /*
     * network.c
     *
     * This file contains the network driver functionality on SYS/BIOS 6.
     *
     * Source: TMS320C6000 Network Developer's Kit (NDK) Software User's Guide, spru523_ug.pdf
     *
     * Copyright (C) 2012 Yacob Hassidim - yacobh@zahav.net.il
     *
     *
     */
    
    /**
     * \file      network.c
     *
     * \brief     This file contains the network driver implemented for SYS/BIOS 6.
     *
     *
     * \author    Yacob Hassidim
     *
     * \version   0.1  created for the OMAPL138 and C6748 platforms.
     *
     */
    
    /* ========================================================================== */
    /*                              INCLUDE FILES                                 */
    /* ========================================================================== */ 
    #include <xdc/std.h>
    #include <string.h>
    #include <xdc/runtime/Memory.h>
    #include <xdc/runtime/Log.h>
    #include <xdc/runtime/Error.h>
    #include <xdc/runtime/System.h>
    #include <xdc/runtime/log.h>
    #include <ti/sysbios/knl/Semaphore.h>
    #include <ti/sysbios/knl/task.h>
    
    #include <netmain.h>
    
    //#include <stdio.h>
    
    /* ========================================================================== */
    /*                              INCLUDE FILES - Application                   */
    /* ========================================================================== */ 
    
    #include "network.h"
    #include "TcpServer.h"
    
    /* ========================================================================== */
    /*                            EXTERNAL VARIABLES                              */
    /* ========================================================================== */ 
    
    
    /* ========================================================================== */
    /*                             MACRO DEFINITIONS                              */
    /* ========================================================================== */
    
    
    /* ========================================================================== */
    /*                           LOCAL FUNCTION PROTOTYPES                        */
    /* ========================================================================== */  
    static void NetworkOpen();
    static void NetworkClose();
    static void NetworkIPAddr( IPN IPAddr, uint IfIdx, uint fAdd );
    
    /* ========================================================================== */
    /*                             GLOBAL VARIABLES                               */
    /* ========================================================================== */
    char *LocalIPAddr = "194.16.11.12";
    char *LocalIPMask = "255.255.255.0";
    char *GatewayIP = "194.16.10.1";
    char *HostName = "testhost";
    char *DomainName = "demo.net";
    
    static HANDLE hTcpServer=0;
    static HANDLE hNetworkTask=0;
    
    
    /* ========================================================================== */
    /*                           FUNCTION DEFINITIONS                             */
    /* ========================================================================== */ 
    
    /**
     * \brief The NetworkTask() function consists of the main 
     *        initialization thread for the stack. It creates a new configuration, 
     *        adds a static IP address, subnet, and default gateway, and then boots 
     *        up the stack.
     * 
     * \param    None
     *
     * \return None
     *
     */
    Void NetworkTask(void)
    {
    int rc;
    CI_IPNET NA;
    CI_ROUTE RT;
    HANDLE hCfg;
    
    	//
    	// THIS MUST BE THE ABSOLUTE FIRST THING DONE IN AN APPLICATION!!
    	//
    	rc = NC_SystemOpen( NC_PRIORITY_LOW, NC_OPMODE_INTERRUPT );
    	//rc = NC_SystemOpen( NC_PRIORITY_HIGH, NC_OPMODE_INTERRUPT );
    	if( rc )
    	{
    		printf("NC_SystemOpen Failed (%d)\n",rc);
    
    		for(;;);
    	}
    
    	//
    	// Create and build the system configuration from scratch.
    	//
    	// Create a new configuration
    	hCfg = CfgNew();
    	if( !hCfg )
    	{
    		printf("Unable to create configuration\n");
    
    		goto main_exit;
    	}
    	// We better validate the length of the supplied names
    	if( strlen( DomainName ) >= CFG_DOMAIN_MAX ||
    		strlen( HostName ) >= CFG_HOSTNAME_MAX )
    	{
    		printf("Names too long\n");
    
    		goto main_exit;
    	}
    	// Manually configure our local IP address
    	bzero( &NA, sizeof(NA) );
    	NA.IPAddr = inet_addr(LocalIPAddr);
    	NA.IPMask = inet_addr(LocalIPMask);
    	strcpy( NA.Domain, DomainName );
    	NA.NetType = 0;
    	// Add the address to interface 1
    	CfgAddEntry( hCfg, CFGTAG_IPNET, 1, 0,
    	sizeof(CI_IPNET), (UINT8 *)&NA, 0 );
    	// Add our hostname
    	CfgAddEntry( hCfg, CFGTAG_SYSINFO, CFGITEM_DHCP_HOSTNAME, 0,
    	strlen(HostName), (UINT8 *)HostName, 0 );
    	// Add the default gateway. Since it is the default, the
    	// destination address and mask are both zero (we go ahead
    	// and show the assignment for clarity).
    	bzero( &RT, sizeof(RT) );
    	RT.IPDestAddr = 0;
    	RT.IPDestMask = 0;
    	RT.IPGateAddr = inet_addr(GatewayIP);
    	// Add the route
    	CfgAddEntry( hCfg, CFGTAG_ROUTE, 0, 0,
    	sizeof(CI_ROUTE), (UINT8 *)&RT, 0 );
    
    	// Boot the system using this configuration
    	//
    	// We keep booting until the function returns less than 1. This allows
    	// us to have a "reboot" command.
    	//
    	do
    	{
    		//rc = NC_NetStart( hCfg, NetworkStart, NetworkStop, NetworkIPAddr );
    		rc = NC_NetStart( hCfg, NetworkOpen, NetworkClose, NetworkIPAddr );
    
    		printf("Network task: after NC_NetStart, rc: %d.\n", rc);
    
    	} while( rc > 0 );
    
    	// Delete Configuration
    	CfgFree( hCfg );
    	// Close the OS
    
    	main_exit:
    	NC_SystemClose();
    
    	printf("Network task: closed.\n");
    
    	/* post semaphore */
    	Semaphore_post(semaphoreNetworkStopped);
    
    	return;
    }//NetworkTask
    
    //
    // System Task Code
    //
    //
    // NetworkOpen
    //
    // This function is called after the configuration has booted
    //
    static void NetworkOpen()
    {
    	printf("Network Open start.\n");
    
        hTcpServer  = TaskCreate( TcpServer,  "TcpServer", OS_TASKPRINORM, 0x2000, 0, 0, 0 );
    
    	printf("Network Open end.\n");
    
    }//NetworkOpen
    
    //
    // NetworkClose
    //
    // This function is called when the network is shutting down,
    // or when it no longer has any IP addresses assigned to it.
    //
    static void NetworkClose()
    {
    	printf("Network close start.\n");
    
        fdCloseSession( hTcpServer );
    
        // Kill any active console
        //ConsoleClose();
    
        // If we opened NETCTRL as NC_PRIORITY_HIGH, we can't
        // kill our task threads until we've given them the
        // opportunity to shutdown. We do this by manually
        // setting our task priority to NC_PRIORITY_LOW.
        TaskSetPri( TaskSelf(), NC_PRIORITY_LOW );
    
        TaskDestroy( hTcpServer );
    
    	printf("Network close end.\n");
    
    }//NetworkClose
    
    //
    // NetworkIPAddr
    //
    // This function is called whenever an IP address binding is
    // added or removed from the system.
    //
    static void NetworkIPAddr( IPN IPAddr, uint IfIdx, uint fAdd )
    {
    IPN IPTmp;
    
        if( fAdd )
    	{
            printf("Network Added: ");
    	}
        else
    	{
            printf("Network Removed: ");
    	}
    
        // Print a message
        IPTmp = ntohl( IPAddr );
        printf("If-%d:%d.%d.%d.%d\n", IfIdx,
                (UINT8)(IPTmp>>24)&0xFF, (UINT8)(IPTmp>>16)&0xFF,
                (UINT8)(IPTmp>>8)&0xFF, (UINT8)IPTmp&0xFF );
    }//NetworkIPAddr
    
    //
    // NetworkServerOpen
    //
    // This function opens the network servers
    //
    void NetworkServerOpen(void)
    {
    	printf("Network Server open.\n");
    
        hTcpServer  = TaskCreate( TcpServer,  "TcpServer", OS_TASKPRINORM, 0x2000, 0, 0, 0 );
    
    }//NetworkServerOpen
    
    //
    // NetworkServerClose
    //
    // This function closes the network servers.
    //
    void NetworkServerClose(void)
    {
    	printf("Network Server close.\n");
    
        fdCloseSession( hTcpServer );
        TaskDestroy( hTcpServer );
    
    }//NetworkServerClose
    
    //
    // NetworkTaskStart
    //
    // This function starts the network task.
    //
    void NetworkTaskStart(void)
    {
    	printf("Network task before create.\n");
    
    	hNetworkTask  = TaskCreate(NetworkTask,  "networkTask", OS_TASKPRINORM, 0x2000, 0, 0, 0 );
    
    }//NetworkTaskStart
    
    //
    // NetworkTaskStop
    //
    // This function stops the network task.
    //
    void NetworkTaskStop(void)
    {
    	printf("Network task stop.\n");
    
    	NC_NetStop(0);
    
    }//NetworkTaskStop
    
    
    /* ========================================================================== */
    /*                              END OF FILE                                   */
    /* ========================================================================== */
    
    4024.network.h