打印

LM3S3739SSI读不到数据?

[复制链接]
2237|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
yuchl|  楼主 | 2010-8-23 15:59 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
lm, pi, se, IO, GPIO
LM3S的SPI,用SPI读写TC72一直都不到数据,设置如下。
    // Enables a peripheral SSI0
    SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
    // Configures pin(s) for use by the SSI peripheral
    // PA2 SSI0CLK(SSCK)  PA4 SSI0RX(MISO) PA5 SSI0TX(MOSI)
    GPIOPinTypeSSI(GPIO_PORTA_BASE, (GPIO_PIN_2 | GPIO_PIN_4 | GPIO_PIN_5));
    // PA2 SSI0CLK(SSCK)
    //GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_2);
    // PA4 SSI0RX(MISO)
    //GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_4);  
    // PA5 SSI0TX(MOSI)
    //GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_5);

    // Disables the synchronous serial interface  
    SSIDisable(SSI0_BASE);

   // Configure the SSI, 1MHZ  
    SSIConfigSetExpClk(SSI0_BASE,   // Base
                                 //SysCtlClockGet(),  // SSIClk
                                20000000,            // 5MHZ
                               SSI_FRF_MOTO_MODE_1, // Protocol
                               SSI_MODE_MASTER,     // Mode
                               1000000,             // BitRate
                               8 // DataWidth
         );  
   // Enables the synchronous serial interface  
    SSIEnable(SSI0_BASE);
有用模块读写SPI EEPROM的吗?


  // CS 25LC256
CS_25LC256 = 0;
// Write Enable
//SSIDataPut(SSI0_BASE, 0x06);
// Read data from memory array beginning at selected address
SSIDataPut(SSI0_BASE, 0x03);
SSIDataPut(SSI0_BASE, 0x00);
SSIDataPut(SSI0_BASE, 0x00);
//while((HWREG(SSI0_BASE + SSI_O_SR) & 0x04) == 0x04)
//{ SSIDataGet(SSI0_BASE, pulData);}
SSIDataPut(SSI0_BASE, 0xFF);
SSIDataGet(SSI0_BASE, pulData++);
CS_25LC256 = 1;


读不到数据?

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

165

主题

722

帖子

2

粉丝