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代码是错误的

相关推荐
en.en..12 小时前
STM32 定时器预分频器 TIMx_PSC 详解
单片机·嵌入式硬件
碧海银沙音频科技研究院1 天前
奥克斯老手机电路图
嵌入式硬件
希和20272 天前
江科大 51 单片机笔记:DS18B20 温度传感器 + LCD1602 显示代码详解
笔记·单片机·mongodb
不脱发的程序猿2 天前
ESP32制作加热杯垫
嵌入式硬件·物联网·esp32·语音识别
Zwawa2 天前
陀螺仪数据为什么看起来总在动:零偏、噪声和零漂
c语言·单片机·嵌入式
元器件BOM超人2 天前
GD32F130G8U6TR QFN-28 兆易创新超值型Cortex-M3 MCU 解析
单片机·嵌入式硬件
硅农程序猿2 天前
SOC 物理实现: RTL2GDS 系列(二)—Innovus 初始化
人工智能·嵌入式硬件·硬件架构
希和20272 天前
51 单片机学习笔记:LCD1602、独立按键、I2C 与 AT24C02 掉电存储(江科大课程小白笔记)
笔记·单片机·学习
碧海银沙音频科技研究院2 天前
BP寻呼机原理
人工智能·嵌入式硬件
希和20273 天前
江科大 51 单片机课程笔记:DS1302 实时时钟 + LCD1602 可调电子钟(小白逐行讲解)
笔记·单片机·嵌入式硬件