linux io模拟时序,io模拟spi时序(IO simulation SPI timing).doc

io模拟spi时序(IO simulation SPI timing)

io模拟spi时序(IO simulation SPI timing)

Module: IO accumulation simulation SPI timing 18:21:09| classification: 2011-05-19 embedded development | Tags: | report | font

in

Small subscription

Motorola SPI is proposed a bus structure, than PHILPS proposed IIC bus more than two lines, these two kinds of bus structure because they occupy the IO port and has been widely used, in general, SPI bus and IIC bus are simulated by IO, there are a considerable number of integrated chip IIC and SPI, such as STC12C60S2 in integrated SPI interface. Let's use analog SPI to communicate!!!!

Program from a simulation forum inside, mainly want to accumulate a SPI driver, and to understand how to write programs based on the chip timing diagram. Of course, you can practice English, because the damn data manuals are all in english!!!!

/*********************************************************************************************

Program name:

Author: Li Cong

Writing time: 20 days

Hardware support:

Interface description:

Edit log:

NO.1-

/*********************************************************************************************

Description: a complete simulation of SPI interface design, 25AA020AEEPROM microcontroller and microchip company communicate with SPI interface

From the timing diagram: when writing a byte, write permission, write instructions, write the address, and then write data, and then determine whether the data is transmitted.

When you read a byte, write the instruction first, then write the address, and then you can read the byte.

/*********************************************************************************************/

#include

#include

#define uchar unsigned char

#define uint unsigned int

/*********************************************************************************************/

Sbit SCK=P2^0; / / clock

Sbit SI=P2^2; / / SCM input interface chip SO, so as to input

Sbit SO=P2^1; / / MCU output interface chip SI

Sbit CS=P2^3; / / enable connection c

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值