MCU & FPGA调试

  1. MCU(dsPIC33) SPI调试
    a. MOSI output
    /Data change at rising edge, and slave sample at falling edge
c 复制代码
void InitSPI2(void) 
{  // since sending only, no need for INTS.
	FPGA_CS_N_OUT_LED16_En; //FPGA_CS# select
	FPGA_CS_N_LED16_En = 1;//FPGA_CS# high
	
	IFS2bits.SPI2IF = 0; //Clear the interrupt flag
	IFS2bits.SPI2EIF = 0; //0-Dis Int, 1--En

	SPI2CON1bits.DISSCK = 0;// 0-enable clk
	SPI2CON1bits.DISSDO = 0;// 0-enable SDO
	SPI2CON1bits.MODE16 = 0;// 1--16bits transfer.0--8 bit
	SPI2CON1bits.SMP = 0; //0--sample during data; 1--sample end of data
	//Data change at rising edge, and slave sample at falling edge
	SPI2CON1bits.CKE = 1; //1--Data shift out at clk from work to idle
	SPI2CON1bits.CKP = 1;// 1--CLK is 1 at idle state and clk is 0 at work
	SPI2CON1bits.SSEN = 0; //0--Not use CS pin
	SPI2CON1bits.MSTEN = 1; //1--Master mode
	SPI2CON1bits.SPRE = 0x06;//b110--Sub clock 2:1 presale
	SPI2CON1bits.PPRE = 0x10; //b10--main clock 4:1 prescale�� b01-16:1

	SPI2BUF = 0x0000;
	
//	SPI1CON1 = 0x057A;				// 0000 0000 0111 1111
	SPI2STATbits.SPIROV = 0;		// Clear Overflow bit
	SPI2STATbits.SPIEN = 1;			// Enable the peripheral

	IEC2bits.SPI2IE = 0;   //0-- Dis SPI INT, 1-En
	FPGA_CS_N_LED16_En = 0;//Enable FPGA CS#
}
复制代码
**?现在问题,怎么MCU读取FPGA数据 Via MISO** 
  1. FPGA调试
    a: FPGA收到的数据是正确的 via MOSI, 通过FPGA Reveal analyzer抓取的数据。

b. 但是发送出的数据是错误的 via miso

发送8'h44, 现在FPGA代码是错误的

相关推荐
老当益壮梁奶奶7 小时前
51单片机DS18B20温度传感器详解:单总线时序与C51驱动实现
笔记·stm32·单片机·嵌入式硬件·51单片机
Horn Still Sounds7 小时前
ARM嵌入式基础|内核、寄存器、架构、存储、汇编移位全面梳理
arm开发·单片机·嵌入式硬件·硬件架构
星栖与芯7 小时前
LiteOS-M 切换汇编逐行图解(2):指令·异常机制·全景表
stm32·单片机·嵌入式硬件·harmonyos·鸿蒙系统
从零开始的嵌入式之旅9 小时前
day44
arm开发·经验分享·笔记·嵌入式硬件
硬禾科技10 小时前
连接世界的工程哲学
嵌入式硬件·测试工具·自动化·硬件工程
深圳市青牛科技实业有限公司 小芋圆10 小时前
GC1808:高性能、低成本的立体声音频ADC芯片
人工智能·嵌入式硬件·无人机·太阳能逆变器
fhq_fn_jgd11 小时前
51单片机(串口通信)
单片机·嵌入式硬件
深圳市元恩微科技开发有限公司11 小时前
兆讯恒达(北京兆讯)MH2457 系列 国产屏驱 MCU
单片机
FPGA小迷弟11 小时前
FPGA 应用技术能力的完整闭环(1-4)
fpga开发·dsp开发·fpga·sdr·无线电
沸速存储11 小时前
AI 机器人靠哪些内存与存储驱动整机运行?
服务器·科技·嵌入式硬件·电脑