如题,我使用了Micro2440核心板的SPI1口,外接了自己的芯片,按照论坛上的方法生成了spidev1.0节点,目前现象:
1、使用spidev_test.c程序,MISO、MOSI互相连接时可以看到正确的输出;
2、此时的设置是MISO、MOSI均激活了上拉,片选信号nSS1也设置为上拉,时钟信号未激活上拉;
程序如下:
s3c2410_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPG7_SPICLK1);
s3c2410_gpio_cfgpin(S3C2410_GPG(6), S3C2410_GPG6_SPIMOSI1);
s3c2410_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPG5_SPIMISO1);
s3c2410_gpio_pullup(S3C2410_GPG(3), 1);
s3c2410_gpio_pullup(S3C2410_GPG(5), 1);
s3c2410_gpio_pullup(S3C2410_GPG(6), 1);
3、MISO和MOSI不连接时,接收到的数据是随机的。有时候全是0,有时候夹杂有随机的数据。而且我修改了驱动,将片选nSS1一直置为低电平。
问题:
1、主机的nSS1能和从机的CSn接在一起么?可以一直设为低电平么?
2、外接芯片描述为: The digital inputs SCLK, SI and CSn are high-impedance inputs (no internal pull-up) and should have
external pull-ups if not driven. SO is high-impedance when CSn is high. An external pull-up should be
used at SO to prevent floating input at microcontroller. Unused I/O pins on the MCU can be set to outputs
with a fixed '0' level to avoid leakage currents.
新手请问哪些管脚在驱动中该配置为激活上拉电阻?
3、为何时钟信号输出有问题?要么没有,要么为三角波和梯形波的组合?
谢谢达人解惑