完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
问候语!首先,我要注意的是,我有一个工作电路板25AA02E48和PIC18。所以现在我改变了控制器,我不能从这个EEPROM读取任何东西。我在CS上有上拉电阻,其他SPI引脚直接连接到UC。我用同样的问题来读/写:WP和保持线通过4.7K电阻连接到VCC。问题是SDI线(EEPROM的SDO)总是保持高电平。每卖出一个,就有255个。我试图在同一线路上设置一个下拉电阻-线路保持在低状态。你能帮助我吗?我可以看到逻辑分析仪上的所有行,我肯定我正在发送正确的值。只是EEPROM不响应!有什么建议吗?谢谢!
以上来自于百度翻译 以下为原文 Greetings! First I want to notice I have a working PCB with 25AA02E48 and PIC18. So now I changed the controller and I can`t read anything from this EEPROM. I have pull-up resistor on the CS and the other SPI pins are connect straight to the uC. I`m using the same problem for read/write: void EEPROMInit() { EEPROM_CS_Init(); EEPROM_CS_Set(0); Delay_ms(1); EEPROM_CS_Set(1); } void WriteEnableSequence() { EEPROM_CS_Set(0); Delay_ms(5); spi_xfer(EEPROMWREN); Delay_ms(5); EEPROM_CS_Set(1); Delay_ms(1); } void WriteDisableSequence() { EEPROM_CS_Set(0); Delay_ms(5); spi_xfer(EEPROMWRDI); Delay_ms(5); EEPROM_CS_Set(1); Delay_ms(1); } void WriteByteToAddress(unsigned char data,unsigned char address) { WriteEnableSequence(); EEPROM_CS_Set(0); Delay_ms(5); spi_xfer(EEPROMWRITE); Delay_us(50); spi_xfer(address); Delay_us(50); spi_xfer(data); Delay_ms(5); EEPROM_CS_Set(1); Delay_ms(1); WriteDisableSequence(); Delay_ms(5); } unsigned char ReadDataFromAddress(unsigned char address) { int data; EEPROM_CS_Set(0); //__delay_ms(5); Delay_us(50); spi_xfer(EEPROMREAD); Delay_us(50); spi_xfer(address); Delay_us(50); data=spi_xfer(0); EEPROM_CS_Set(1); Delay_ms(5); return data; } WP and HOLD lines are connected to Vcc through 4.7k resistors. The problem is the SDI line(SDO of the EEPROM) always stays high! As there is 255 in every sell. I tried to put a pull down resistor on the same line -> the line stays in low state... Can you help me? I can see all the lines on the logic analyzer and I`m positive I`m transmitting the correct values. Just the EEPROM doesn`t respond! Any suggestions? Thanks! |
|
相关推荐
2个回答
|
|
你使用的引脚,特别是SDI引脚,在“数字”模式。我不清楚你实际上看到的逻辑分析仪:CS,SCK和SDO线显示正确的值?如果你正在读取0xFF,那么你确定你已经编程了EEPROM,因为0xFF是每个单元的“擦除”状态。还有,所有“延迟”调用的要点是什么?他们需要的唯一时间是EEPROM执行“写入”,甚至最好的方法是读取状态寄存器直到“WIP”位清晰。苏珊
以上来自于百度翻译 以下为原文 Are the pins you are using, especially the SDI pin, in 'digital' mode. I'm not clear on what you are actually seeing on the logic analyser: are the CS, SCK and SDO lines showing the correct values? If you are reading back 0xff, then are you sure that you have programmed the EEPROM as 0xff is the 'erased' state for each cell. Also, what is the point of all of the 'delay' calls. The only time they might be needed is while the EEPROM is executing a 'write' and even then the best way is to read the status register until the 'WIP' bit is clear. Susan |
|
|
|
“25AA02E48和PIC18”有很多PIC18和几个不同的世代,哪一个?所以现在我改变了控制器“这是更加开放的结束”。这是一个不同的芯片吗?一个不同的PIC18?另一张照片?另一个牌子?”我在CS和其他SPI引脚上有上拉电阻,除了芯片选择外,大部分都是不需要的(在复位时只需要它)。“你能帮助我吗?”不,没有涉及芯片的零件号。猜测你没有配置更复杂的PIC32(mm)?MX?MZ?)正确的SPI外围设备。或者根本看不到它的配置。
以上来自于百度翻译 以下为原文 "25AA02E48 and PIC18" There are lots of PIC18's and several different Generations of them. Which one? "So now I changed the controller " That is even more open ended. Is it a different Chip? a different PIC18? another PIC? another brand? " I have pull-up resistor on the CS and the other SPI pins" That would be mostly unneeded except for the Chip select ( and that would only be needed at reset.) "Can you help me?" No, not with out the Part numbers of the Chips involved. A Guess you did not configure the More complicated PIC32 (MM?MX?MZ?) SPI Peripheral correctly. or at all I do not see it configured. |
|
|
|
只有小组成员才能发言,加入小组>>
5163 浏览 9 评论
2000 浏览 8 评论
1928 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3174 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2226 浏览 5 评论
733浏览 1评论
615浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
505浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
631浏览 0评论
528浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-24 00:08 , Processed in 1.442223 second(s), Total 79, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号