随笔分类 -  avr单片机

摘要:二.一下为使用AVR处理器自身SPI接口的程序使用,已验证通过。#ifndef SPI12864_H#define SPI12864_H//包含所需头文件#include <avr/io.h>#include <avr/interrupt.h>#include<util/delay.h>#include"Date.h"/*------引脚定义------*/#define CS_H PORTB|=(1<<PB0)#define CS_L PORTB&=~(1<<PB0)#define SCLK 7#defi 阅读全文
posted @ 2013-03-01 14:46 丁洋 阅读(766) 评论(0) 推荐(0)
摘要:12864显示器的SPI串行驱动问题,可以使用模拟或AVR处理器自身的SPI接口,以下为已经成功运行的代码,现贴出共同学习。一.以下是使用模拟SPI时序的程序,这点好处是在没有SPI接口的处理器中模拟使用,缺点是速度较慢#ifndef AVR12864_H_#define AVR12864_H_#include <avr/io.h>#include <avr/delay.h>#define uchar unsigned char#define uint unsigned int//clk---en sid---rw cs---rs#define clk0 PORTA & 阅读全文
posted @ 2013-03-01 14:44 丁洋 阅读(894) 评论(0) 推荐(0)