spi

MSP430F5438 SD card using an SPI interface

僤鯓⒐⒋嵵緔 提交于 2019-12-11 12:05:59
问题 I want to connect an SD card using the SPI interface of MSP430F5438. The hardware part is correct in my design, however I could not send any data to the SD card. The source code I use is from Secure Digital Card Interface for the MSP430 . For debugging, how could I send data to the SD card? The data should be received from the ADC12MEM registers and just need to be written in the SD card. From this source code above, there is no process, when I debug and I could not send any user input to the

SPI Protocol Procedure

隐身守侯 提交于 2019-12-11 11:44:07
问题 hey i am using ADS1292 for my own project, and myself is confused with SPI protocol. i found some code on the internet and i found it sends and receive at one time. for example, i want to send 0xFF to slave device. then it sends the data first and wait for a receive. And when receiving data, it sends a dummy byte and then receive. Anyone please explain why they do this? uint8_t sEE_ReadByte(void) { return (sEE_SendByte(sEE_DUMMY_BYTE)); } uint8_t sEE_SendByte(uint8_t byte) { /*!< Loop while

How does kernel code knows which spi bus is using?

独自空忆成欢 提交于 2019-12-11 10:39:16
问题 I modified device tree file and enable spi using 4 GPIO pins, which support pinmux and switch from gpio to spi function. But in Linux kernel code, how does the code know which spi bus/pins is used? For example, I find a Linux kernel driver: max1111.c, which drives a spi ADC chip. But I checked its code, and don't find where the spi bus/pins is specified. I paste max1111.c below. /* * max1111.c - +2.7V, Low-Power, Multichannel, Serial 8-bit ADCs * * Based on arch/arm/mach-pxa/corgi_ssp.c * *

create a small delay in a Linux interrupt handler

耗尽温柔 提交于 2019-12-11 08:13:37
问题 I'm working on an interrupt handler with a hardware design group and we're trying to figure out where a bug is. I'm reading a chip over the SPI bus at 5khz. The chip loads 4 bytes and triggers a data ready pin. My interrupt handler wakes up and read 4 bytes off the SPI bus and stores the data in a buffer. Strangely enough though, every 17th read gives 4 bytes of all 0's, which is not right. One of the options we're exploring is that the chip isn't always actually ready when it sends the data

Basic device operations in spi driver

◇◆丶佛笑我妖孽 提交于 2019-12-11 06:59:19
问题 I need to write an spi driver for omap4 from scratch. I am referring http://lxr.free-electrons.com/source/drivers/spi/spi-omap2-mcspi.c driver code. But, I am unable to understand how basic device operations are handled in this driver code. For example a char driver has the structure struct file_operations scull_fops = { .owner = THIS_MODULE, .llseek = scull_llseek, .read = scull_read, .write = scull_write, .ioctl = scull_ioctl, .open = scull_open, .release = scull_release, }; containing the

Cannot configure SPI0 on BeagleBone Green Wireless

半腔热情 提交于 2019-12-11 06:27:27
问题 Note: the selected answer is the original one that solved the problem, for more details refer to the additional one below. I'm not able to configure SPI0 on my BeagleBone Green Wireless (BBGW). I'm trying to achieve this without using overlays, only pure DeviceTree. /dev/spidev1.0 and /dev/spidev1.1 are there, but any I/O returns garbage. Oscilloscope connected to SCLK displays mostly noise, here are pictures (each in different time scale). Important parts of my .dts/.dtsi: &am33xx_pinmux {

Read and write to spi eeprom on linux

主宰稳场 提交于 2019-12-11 04:57:07
问题 I want to use my spi eeprom (at25) under debian (Beaglebone Black). I have edited the device tree, so now i can read and write to eeprom. There is already a spi-at25-driver in Linux. Reading from eeprom cat /sys/class/spi_master/spi1/spi1.o/eeprom writing to eeprom echo hello > /sys/class/spi_master/spi1/spi1.o/eeprom But i want to write and read from specific address of the eeprom. Is there any way to do this within a C-Program? thx 回答1: As the eeprom here is mapped to a file representation

What's the relationship between GPIO and SPI?

自作多情 提交于 2019-12-10 19:52:02
问题 I found GPIO driver in the kernel leave /sys/class/gpio to control gpio, but I found GPIO can be controlled by /dev/mem as well, I found this mapping may be done in the spi-bcm2708 (which call the __ioremap as a platform driver), but I don't understand the relationship between spi and GPIO,how they work together in the linux? 回答1: As I understand you are talking about this driver (which is used, for example, in Raspberry Pi). First of all, take a look at BCM2835 datasheet. Review next

Motorola和TI的SPI的区别

时光毁灭记忆、已成空白 提交于 2019-12-10 10:38:24
https://e2echina.ti.com/question_answer/analog/interface_and_clocks/f/59/t/46369 http://www.openedv.com/forum.php?mod=viewthread&tid=89630&page=1 如果是SPI接口,那么应该是一样的,因为都要遵守SPI的规范。如果你问的是TI的类SPI接口,请参考下面的描述。 SSI(Synchronous Serial Interface)由TI公司定义的接口协议标准 SPI(Serial Peripheral Interface)是由Motorola公司定义的接口协议标准,两者的用法有类似的地方 SPI串行帧同步SSIFss为低电平有效,在整个帧传输期间生效(拉低)。 SSI串行帧同步SSIFss在发送每个帧之前产生宽度为个时钟周期的高脉冲。SSI 模块和片外从设备都在SSIClk 的上升沿驱动输出数据,在SSIClk 的下降沿锁存另一端的输入数据。 本帖最后由 fiekis 于 2016-11-29 17:50 编辑 motorola 叫SPI 协议, TI 叫SSP 协议 主要是片选有点不一样 一般我们说的都是motorola的 来源: CSDN 作者: wowo004 链接: https://blog.csdn.net/wowo004

STM32+DAC8830驱动程序

无人久伴 提交于 2019-12-10 10:19:24
1、DAC8830介绍 DAC8830是一款TI的DAC输出芯片,他支持16bit数据出入,同时建立时间为1us,支持标准的SPI接口,最快可支持50Mhz,如下为DAC8830的基本封装: 2、STM32,SPI介绍 因为DAC8830仅支持单线通信,即只接收收据,不回复数据,所以STM32这边可以设置为单线发送,SPI_Direction_1Line_Tx,具体配置如下: 首先需要初始化相关引脚,CS、CLK、MOSI三个引脚。 //SPI_CS GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12; GPIO_Init(GPIOB, &GPIO_InitStructure); GPIO_SetBits(GPIOB, GPIO_Pin_12); //SPI_CLK,SPI_MOSI GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13 | GPIO_Pin_15; #ifndef USE_ANALOG GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; #endif GPIO_Init(GPIOB, &GPIO_InitStructure); 而后,初始化SPI模块,如下: SPI_InitTypeDef SPI_InitStructure; RCC