要换到mega64上,SPi驱动部分更新如下
DDRB |= ((1<<PB0)|(1<<PB1)|~((1<<PB3))|(1<<PB2));
SPCR = (1<<SPIE)|(1<<SPE)|(1<<MSTR);
SPSR = 0x0;
mega8的spi驱动如下
DDRB |= ((1<<PORTB2)|(1<<PORTB3)|(1<<PORTB5));
PORTB &= ~((1<<PORTB2)|(1<<PORTB3)|(1<<PORTB5));
SPCR = ((1<<SPE)|(1<<MSTR)|(1<<SPR0));
,protues仿真 数据就采集不上来了,管脚都对应上了,反复修改分频,都没有成功
|