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

相关推荐
木子单片机18 分钟前
基于51单片机计步器—无线蓝牙APP上传
单片机·嵌入式硬件·51单片机·keil
智者知已应修善业41 分钟前
【51单片机只有一个8*8点阵数据如何滚动起来一片595+一组IO+花样】2022-1-15
c++·经验分享·笔记·单片机·蓝桥杯·硬件架构
恒锐丰科技林技术员41 分钟前
EG2123A 三相独立半桥驱动芯片解析与工程应用
经验分享·嵌入式硬件·硬件工程
硅基手札1 小时前
【Linux 内核专栏 13】快IO层
linux·服务器·嵌入式硬件
李日华大战鸡红1 小时前
滑膜观测器(学习记录)
stm32·单片机·学习·matlab·机器人
白搞电子1 小时前
ESP32-S31 项目如何制作 Windows 一键烧录包:完整镜像、esptool 与数据边界
windows·stm32·单片机
xiangw@GZ2 小时前
纽扣电池型号
嵌入式硬件
优信电子2 小时前
Raspberry Pi Pico 硬件开发 —— 第二课:MicroPython 从入门到项目实践(LED篇)
单片机·嵌入式硬件·树莓派·micropython·pico·入门教学
szxinmai主板定制专家2 小时前
基于TI AM62x+FPGA的24bit高精度数据采集卡设计(振动/风电/发动机监测)
人工智能·fpga开发·arm+fpga·rk3588+fpga
黑妹天下第一乖2 小时前
第 12 讲:阿加犀 AidLux 部署与量产——把端侧 AI 应用做成 7×24 产品
人工智能·嵌入式硬件·数码相机·接口隔离原则·iot