完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
几个月来,我一直在疯狂地思考这个问题。我已经切换到4个不同的编译器(BooSTC,PICBASIC,C18,XC8),试图让这个垃圾工作,并没有发现任何工作。我为每个编译器(不是XC8)找到了一个实际上不起作用的“工作”版本。有些人有原理图,好像他们可以工作,这不起作用。我只是尝试写1个愚蠢的文件到一个SD卡。有没有人,在任何地方谁有一个实际工作项目在上述任何一个联系人与一个真正正确的示意图谁愿意分享他们所拥有的?如果不是,那我就辞职,我会找到一个与众不同的嗜好,因为生命太短暂了,不能做一些不重要的事情。我会感谢你的帮助。但是,请不要告诉他们只是去拿陈的文件IO垃圾。试过了。不知道如何使它发挥作用。也许我只是为了这个东西愚蠢。
以上来自于百度翻译 以下为原文 I have been banging my freakin head on this for months now. I have switched to 4 different compilers (BoostC, Picbasic, C18, XC8) trying to get this crap to work and have found NOTHING works. I found a 'working' version for each compiler (not XC8) that actually did NOT work. Some had schematics that seemed like they might work, which did NOT work. I am trying just to write 1 stupid file to an sd card. Is there ANYone, ANYwhere who has an ACTUALLY working project in any of the above comiplers WITH an actually correct schematic who would be willing to share what they have? If not, then I quit and am going to find a different freakin hobby, 'cause life's too short to be this PO'd about something that doesn't even freakin matter. I would appreciatye the help though. But, please, don't tell em to just go nad get chan's file io crap. Tried it. No idea how to make it work. Maybe I'm just to freakin stupid for this stuff.... |
|
相关推荐
19个回答
|
|
|
我在几个PIC24上成功地使用过它。我记得在PIC18上使用过脂肪,而不是SD。它应该工作……你指的是什么代码,确切地说?
以上来自于百度翻译 以下为原文 I used it on several PIC24 with success. I remember having used FAT on a PIC18, but not SD. It should work anyway... which code are you referring to, exactly? |
|
|
|
|
|
你打算从PC(或PIC)中读取这个文件吗?什么类型的文件?(格式)。有多大?
以上来自于百度翻译 以下为原文 Do you intend to read this file from a PC (or anything other then the pic)? WHat type of file?(format). How big? |
|
|
|
|
|
我试图写一个文件,这样我就可以在PC上读取它。简单的数据记录器类型的事情。我已经尝试了在PBP上的SDFS3,这是一个FATFS生成的代码,用于18F45 K22和XC8,一本书从“学习飞PIC24”(甚至使用Excel和SD卡适配器的东西)用C30,XPcLoG作为SooSooBoo--更多的Chan-FATFS的东西。有趣的是,每个人总是指向相同的应用笔记和禅师的FATFS。我告诉你,这废话不管用。也许我把电线弄得一团糟,但我甚至无法从PIC24获得预编译的东西,用同一子面板在同一块板上工作。
以上来自于百度翻译 以下为原文 I am trying to write to a file so I can read it on a PC. Simple datalogger type thing. I have tried SDFS3 on PBP, A FatFS generated code for 18F45K22 and XC8, one from the book "learing to fly the pic24" (even used the explorer16 and the sd card adapter thing) with C30, XPiclog for Sourceboost - more of chan's fatfs stuff there. The funny thing is, everyone always points to the same app notes and to chan's fatfs. I'm tellin you, this crap doesn't work. Maybe I've got the wires messed up, but I couldn't even get the precompiled stuff from the pic24 to work on the same board with the same daughterboards. |
|
|
|
|
|
FATFS在PIC18上运行良好,但我不知道你会为你的板找到一个“掉落”项目。这个线程可能会有帮助:HTTP//www. McCHIP.COM/FUMMS/M85 964 7.ASPXAN18F45 K22可能有点边际RAM大小。
以上来自于百度翻译 以下为原文 FatFS works fine on a PIC18, but I don't know that you'll find a "drop in" project for your board. This thread might help: http://www.microchip.com/forums/m859647.aspx An 18F45K22 might be a bit marginal as far as RAM size. |
|
|
|
|
|
下面是FatFs和XC8:SD卡与XC8的工作示例
以上来自于百度翻译 以下为原文 Here is a working example with FatFs and XC8: SD card with XC8 |
|
|
|
|
|
我曾尝试过XC8项目的SD卡。我甚至重试它刚才,相同的芯片18F45 K22。它不起作用。我跟着3个视频到了那封信。我已经检查并重新检查了连接,甚至使用逻辑分析仪来查看数据(MoS/MISO线路上的数据限制为0xFF/0x00)(不知道为什么)。不管怎样,它都不管用。我甚至尝试加载包含在项目下载中的HEX文件。不去。更糟糕的是,CLK被保持在其他任何线路上都没有活动。这是垃圾。在这一点上,我愿意支付一个实际的工作项目(任何人)?我要确信这是不可能做到的,我并不想怀疑,但我不太相信。虽然代码可能适合,但我还没有看到任何实际工作。你有一个有效的版本吗?我会活着去看的。我会使用你正在使用的芯片,根据MPLABX IDE,数据是52%,程序是67%。还有很多余地要做。
以上来自于百度翻译 以下为原文 I've tried the SD Card with XC8 project before. I even retried it just now, same chip 18f45k22. It doesn't work. I followed the 3 videos to the letter. I have checked and rechecked the connections, even using a logic analyzer to see the data - which is limited to 0xff/0x00 on the MOSI/MISO lines (no idea why). Either way, it doesn't work. I even tried to load the hex file that is included in the project download. No go. Even worse - clk is held hi with no activity on any of the other lines. This is junk. At this point I'd pay to see an actual working project (any takers?). I'm about to be convinced that it can't be done. I don't mean to sound sceptical, but I don't really believe this. While the code may fit, I have yet to see anything that actually works. Do you have a version that works? I'd live to see it. I will but the chip you are using and try it. According to mplabx ide the data is at 52% and program is 67%. Plenty of room left to do alot more. |
|
|
|
|
|
当然,它* *工作,我会接受支付点是,需要找到一个像你的照片在我的存储
以上来自于百度翻译 以下为原文 Sure it *has* to work and I would accept a payment Point is, need to find a PIC like yours in my storage |
|
|
|
|
|
好吧,帮我们一个忙(告诉自己),确切地告诉我们“不起作用”是什么意思?SD卡是否被检测到?什么有效,什么不奏效?你确信SD卡上的电压水平是正确的吗?我已经有了Microchip MLA SD卡程序的版本(YEP)。对XC8和汇编进行了修改,在PIC18F、16F和24FJ部件上进行简单的FAT文件读写,可以完成,但需要注意一些事项。2 GB和更小的卡使用一些不同的命令,然后4 GB和更大的卡。真正的大卡片再次使用不同的命令集。
以上来自于百度翻译 以下为原文 OK do us a favor (and yourself) and tell us exactly what "doesn't work" means? Is the sdcard detected or not? What works and what doesn't? Are you sure the voltage levels on the SDCard are correct? I have implimented versions of the Microchip MLA sdcard routines (yep. modified for XC8 and also in assembly) for simple FAT file read/write on pic18F, 16F, and 24FJ parts. It can be done but some care is needed to get everything correct. What size sdcard are you using? 2 GB and smaller cards use some different commands then 4 GB and larger cards. Really big cards use a different set of commands again. |
|
|
|
|
|
我从KATELA发布的链接下载了这个例子,在上面的第6页。(+ 1到KATELA)我确认它将建立。现在,我没有PIC18F45 K22来播放,但是我有一个PIC18F26K22,我以前评估过。所以…我做了一些修改(注释了几个语句),涉及到在“26K22”上没有出现的45 K22寄存器,并建立了PROJ。ECT无其他改变。我用我的好奇心HPC板搭载了一个微型SD突破板,上面安装了26K22。除了浏览下载项目中的代码之外,我没有查看任何视频或做任何其他事情。该项目,如所提供的,没有使用任何资源,在26K22上不可用。示例程序运行良好,与三个小(2 GB,4 GB)的微型SD卡,我可以用于测试。每次程序用给定的SD卡运行,如果没有一个名为“Test.txt”的文件。创建并写入消息。对于后续的运行,它发现文件并在末尾追加消息。我通过从SD卡上拔出SD卡并将其插入我的PC上的USB SD卡读卡器并检查文件来验证这一点。对于下一步,我添加了UART功能和一些消息来指示进度和故障指示器,如果它不能安装文件。系统或在FS安装后无法写入文件。总内存使用(到目前为止)是38%程序内存使用,23%数据内存使用。我在空闲模式下使用MPLABX版本4.05和XC8版本1.44。最初的项目是1.41版。这样做也很好,不知道还能说什么。也许IWFMYMV(它对我来说,你的里程可能会有所不同)。Bottom iine(谢谢你,阿甘):从网上下载的免费软件就像一盒巧克力;你永远不知道你会得到什么。“我一向乐观的妈妈常说,“生活不过是一碗樱桃。”嗯,嗯。这个下载是一个巧克力覆盖的樱桃。嗯,那很好。[开始编辑],我会说更多的东西(有时我就是忍不住):用原来的程序,它运行的Fosc=16兆赫。与SD卡的初始通信是一个250千赫SPI时钟,最后的访问是1兆赫。我把Fosc升至64兆赫,使用了1兆赫和4兆赫的SPI时钟。此外,我将注意到,我使用的EL CHEAPO Micro SD突破板是为5V系统(可能是ARDUNO)设计的。董事会中有1117个3.3V的监管者。因为我在3.3V运行我的系统,并且这个设备的辍学率大约为伏特,它将导致SD卡的2.3V。我的无名SD卡非常边缘。我去掉了调节器,将跳线从引脚2焊接到引脚3。在这个(和其他)项目中没有任何问题。如果你想为此付出代价,那么就继续读下去,或者其他一些论坛,并试图帮助你取得成功的领域的其他人。我对经常指责我的帖子过于冗长的说法表示歉意。但我认为,如果人们报告问题,将告诉我们究竟他们是如何测试的,以及他们测试时究竟看到了什么意外的结果,我们都可以节省一大堆带宽在论坛上。更不用说为获得有意义的反应节省原始海报的时间。[ /最终编辑]问候,戴夫
以上来自于百度翻译 以下为原文 I downloaded the example from the link posted by katela in #6, above. (+1 to katela.) I confirmed that it would build. Now, I don't have a PIC18F45K22 to play with, but I do have a PIC18F26K22 that I had previously evaluated. So... I made a couple of changes (commented out a couple of statements) that involved 45K22 registers not present on the '26K22 and built the project with no other changes. I hooked up a Micro-SD breakout board by jumpers to my Curiosity HPC board with the '26K22 mounted on it. I didn't look at any videos or do anything else except browse the code in the downloaded project. The project, as supplied, did not use any resources that are not available on the '26K22 The example program runs just fine with the three small (2 GB, 4 GB) Micro-SD cards that I have available for testing. Each time the program is run with a given SD card, if there is not a file named "TEST.TXT" it creates it and writes a message. For subsequent runs it discovers the file and appends the message at the end. I verified this by unplugging the SD card from the breakout board and plugging it into a USB SD card reader on my PC and examining the file. For the next step, I added UART functionality and some messages to indicate the progress and failure indicators that showed if it wasn't able to mount the file system or if it couldn't write to the file after the FS was mounted. Total memory usage (so far) is 38% program memory usage, 23% data memory usage. I used MPLABX version 4.05 and XC8 version 1.44 in Free mode. The original project was for version 1.41. It worked just fine with that also. Don't know what else to say. Maybe IWFMYMMV (It Works For Me, Your Mileage May Vary). Bottom iine (thank you, Forrest Gump): A free software download from the 'net is "like a box of chocolates; you never know what you're gonna get." My always-optimistic mom used to say things like, "Life is just a bowl of cherries." Well, for me, this download was a chocolate-covered cherry. Mmmm, that's good. [/Begin Edit] Well, I'll say a few more things (sometimes I just can't help myself): With the original program, it ran with Fosc = 16 MHz. Initial communications with the SD card were with a 250 kHz SPI clock, and final access was with 1 MHz. I upped Fosc to 64 MHz and used SPI clocks of 1 MHz and 4 MHz respectively. Also, I will note that the el-cheapo Micro-SD breakout board that I used for this evaluation was designed for 5V systems (probably Arduino). There was a 1117 3.3V regulator on the board. Since I run my systems at 3.3V, and the dropout for this device is about a volt, it would have resulted in 2.3V to the SD card. Very marginal for my no-name SD cards. I removed the regulator and soldered a jumper from Pin 2 to Pin 3. Have had no problems with this (and other) projects. If you want to pay for it, well just pay forward by continuing to read this, or some other, forum and trying to help other people in areas in which you have had some success. [/End Edit] [/Begin Final Edit --- I promise!] I plead guilty to the frequent accusation that my posts tend to be too wordy. But I think that if people reporting problems would tell us exactly how they tested and exactly what unexpected results they saw when they tested, we could all save a bunch of bandwidth on the forum. Not to mention saving time for the original poster in getting meaningful responses. [/End Final Edit] Regards, Dave Attached Image(s) |
|
|
|
|
|
如果你没有遵循简单的指令,不要说链接是垃圾。你没有解释什么是不工作的,代码不是编译,还是卡不能安装。问题甚至可以是你正在使用的SD卡或者你正在格式化的SD卡。
以上来自于百度翻译 以下为原文 If you failed to follow simple instructions, don't say that link is a junk. You didn't explain what is not working, whether the code is not compiling or the card failed to mount.. The problem could even be the SD card you are using or the way you are formatting it. |
|
|
|
|
|
BRA VO,戴夫。在我的拙见中,这是我们在这里的问题和答案中应该关注的细节层次。
以上来自于百度翻译 以下为原文 Bra-vo, Dave. In My Humble Opinion this is the level of detail we should all aim for in our questions and answers here. |
|
|
|
|
|
我有几个使用FDSFS和DSPIC33微处理器的工作项目,但不能共享代码,因为它是给我的雇主的。鉴于你没有详细的细节,我从最基本的猜测开始:你用Windows代替SDFormatter或数码相机来格式化SD卡吗?因为Windows会以一种FatFS无法读取的方式愚蠢地格式化它。
以上来自于百度翻译 以下为原文 I have a few working projects using FatFS with a dsPIC33 micro, but can't share code since it's for my employer. Given your lack of details on what exactly doesn't work, I'll just start from the most basic guess: Did you format the SD card using Windows instead of SDFormatter or a digital camera? Because Windows will stupidly format it in a way that FatFS can't read... Taliesin |
|
|
|
|
|
我如何解决这些问题?好,我从顶部开始。不工作=不执行程序打算执行的功能。根据代码,我的SD卡上应该有一个简单的消息文件。在我的卡上反复运行,把代码从原来的代码调整到今天,什么都不存在。SDO线产生了0xFF的重复输出(我不知道这是从哪里来的),SCL点击得很好,但就是这样。没有其他东西按预期执行。SD卡被检测到了吗?当我用逻辑分析仪监视SDI/SDO/SCL线路时,我从卡上什么反应都不知道。基于这个,我会说,我怀疑它是被检测到的。卡的电压电平是否正确?是的,他们已经被反复检查过了。我使用的是PIC和SD卡的3.3V稳压电源,我使用的是雷克沙的1GB卡,它使用的是微风窗7。我将使用SDFrATATER重新格式化,看看是否有什么变化(我在这一点上没有太多的希望)。我道歉称它是垃圾,因为它看起来对别人有用,但对我不适用。这仅仅暗示了我在OP上所说的,我可能应该去寻找一种不同的爱好,不会因为我的头撞在墙上而导致持续的钝力伤害。
以上来自于百度翻译 以下为原文 How shall I address all these questions? Well, I'll start from the top. Doesn't work = does not perform the functions the program is intended to perform. According to the code, there should be a file on my sd card with a simple message. Neither exist on my card after repeatedly running and tweaking the code form the original to today. what works and doesn't work? Well, the sdo line produces an output of 0xff repeatedly (i don't have any idea where this is coming from), scl clicks off nicely, but that's it. nothing else is performing as expected. Is the SD card detected? I have no idea as I get nothing in response from the card when monitoring the sdi/sdo/scl lines with a logic analyzer. based on this, I would say, I doubt it is being detected. Are the voltage levels for the card correct? Yes, they have been checked repeatedly. I am using 3.3v regulated power supply for both pic and sd card. I am usning 1GB card from Lexar formatted using microshaft windows7. I will reformat using SDFormatter and see if anything changes (I don't have a lot of hope at this point). My apologies for calling it junk as it appears to work for others but not for me. This merely implies what I said in the OP that I probably should just go find a different hobby that does not result in a continual blunt force trauma as I bang my head on this wall. |
|
|
|
|
|
完全相同的结果。0xFF在MOSI上重复,SCL滴答滴答地滴答作响。在SD卡上没有文件。让我问一下:SD卡的引脚是:引脚PIN功能1-DAT3/CS2 CMD/DI(AKSDI,对吗?)3-VSS14-Vcc5-SCL6VSS27—DAT0/DO(AKSDO,对吗?)8DAT19-DAT2目前使用的程序不使用引脚9(DAT2)、8(DAT1)、写保护或芯片检测开关。因此,我将Pi1(DAT3/CS)连接到RC2,Pin 5(SCL)连接到RC3,Pin 7(DAT0/DO)连接到RC4,和引脚2(CMD/DI)连接到RC5;引脚3和6(VSS)被连接到GND,PN4(VCC)被连接到功率轨(3.3V)。我不使用示意图中显示的电平转换器,因为所有的电源都是3.3V。这是不是错了?
以上来自于百度翻译 以下为原文 exact same result. 0xff repeated on MOSI, scl ticking away nicely. no file on sd card. let me just ask this: the pinout for the sd card is as folloows: pin# function 1-dat3/cs 2-cmd/di(aka sdi, right?) 3-vss1 4-vcc 5-scl 6-vss2 7-dat0/do(aka sdo, right?) 8-dat1 9-dat2 the currently used program does not use pins 9(dat2), 8(dat1), write protect or chip detect switches. So, I have pin1(dat3/CS) tied to RC2, pin5(SCL) tied to RC3, pin7(Dat0/DO) tied to RC4, and pin 2(CMD/DI) tied to RC5; pins 3 and 6(vss) are tied to gnd and pin4 (VCC) is tied to power rail (3.3v). I am NOT using the level shifters shown in the schematic as all power is 3.3v. Is this wrong? |
|
|
|
|
|
有一个很小的机会,你连接SDO和SDI错误,你能重新使用MISO和MOSI条款吗?
以上来自于百度翻译 以下为原文 There's a slight chance that you connected SDO and SDI wrong Can you restate using MISO and MOSI terms? |
|
|
|
|
|
SD卡引脚7(DO)连接到PICRC4(MISO)SD卡引脚2(DI)连接到PIC RC5(MOSI)逻辑分析仪显示大约5000字节的0xFF发送(在MoSi)在0.887秒125kHz。MISO线没有答复。
以上来自于百度翻译 以下为原文 sd card pin 7(DO) is connected to pic RC4(MISO) sd card pin 2(DI) is connected to pic RC5 (MOSI) Logic analyzer shows about 5000 bytes of 0xff sent (on the MOSI ine) in 0.887 sec at 125kHZ. No reply on the MISO line. |
|
|
|
|
|
1秒的400万位,比图书馆预期的250K慢一点,但我猜这是因为缺少回复。时钟和CS也能正确移动吗?
以上来自于百度翻译 以下为原文 40000bit in 1 sec circa, a bit slower than the expected 250K the library should start with, but I guess this is due to lack of reply. Are Clock and CS moving correctly too? |
|
|
|
|
|
分析器在CS下降到逻辑0之前显示了几个字节的0xFF,接着是更多的0xFF传输。每个字节在SCL上以121kHz计时,在字节之间有113MS的延迟。在CS返回逻辑1, 2之后,传输更多的0xFF字节。
以上来自于百度翻译 以下为原文 Analyzer shows several bytes of 0xff prior to cs dropping to logic 0, followed by lots more 0xff transmissions. Each byte is clocked at 125KHz on scl with a 113ms delay between bytes. after cs is returned to logic 1, 2 more bytes of 0xff are transmitted. |
|
|
|
|
|
我明白了,那么原理图呢?电源,去耦,电平移位器(如果有的话)?
以上来自于百度翻译 以下为原文 I see. How about schematic, then? Power supply, decoupling, level shifter (if any) ? |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475 浏览 0 评论
5794 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1125浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1098浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 16:56 , Processed in 2.064837 second(s), Total 80, Slave 73 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1304