18F26K20 SD Testing

Coding and general discussion relating to user created compiler modules

Moderators: David Barker, Jerry Messina

xor
Posts: 286
Joined: Sun Nov 05, 2006 1:15 pm
Location: NYC
Contact:

Post by xor » Sat Jan 24, 2009 11:43 pm

I got my hands on some 18F46K20's. My question to successful users of the "K" PIC's with SF is, did you add a new Def file or might it work with the Def file for the 18F4620? Or possibly alter an existing Def file?

Thanks.

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Sat Jan 24, 2009 11:49 pm

The DEF files for the "K" series are available here (look under K series download):
http://www.sfcompiler.co.uk/wiki/pmwiki ... ionHistory

xor
Posts: 286
Joined: Sun Nov 05, 2006 1:15 pm
Location: NYC
Contact:

Post by xor » Sun Jan 25, 2009 12:16 am

Thanks rene, I've been out of circulation for a while. First thing that caught my eye in the Migration Doc was 3V operation!!! That was sneaky... no notes to that effect on the first page of the datasheet.

I had mine mounted on the EasyPIC and tried to program and it failed (using mB). Might have cooked it or maybe it survived a 13V whacking.

How are you programming yours?

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Sun Jan 25, 2009 12:22 am

Oops, that was nasty. The "K"'s are rated for 9V max. on VPP.

None of mE stuff currently supports the "K"s. I use my ol' standby PICKit2.

xor
Posts: 286
Joined: Sun Nov 05, 2006 1:15 pm
Location: NYC
Contact:

Post by xor » Sun Jan 25, 2009 12:39 am

There is the new 18FJ LV Programmer.... wondering if that can work? Seems that I'm slowly being pushed into the 3V neighborhood by Microchip as I look for more processing speed. :?

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Sun Jan 25, 2009 12:54 am

I think that question was asked on mE's DEV BOARDS forum but the 18F-LV does not support the "K"s. See post #2 here:
http://www.mikroe.com/forum/viewtopic.php?t=17910

Might be time to look at the PIC24/dsPIC33 if you are going 3.3V anyway:
http://www.sfcompiler.co.uk/forum/viewtopic.php?t=901

User avatar
ohararp
Posts: 194
Joined: Tue Oct 03, 2006 11:29 pm
Location: Dayton, OH USA
Contact:

Post by ohararp » Sun Jan 25, 2009 5:46 pm

A couple of updates on the 18F26K20:
1. 64 MHz works great! 16MHz resonator with PLL
2. Programming 18F26K20 is the same as an 18LF2620 using the Pickit2

I still haven't gotten the SPI port to work with Steven's SD Library, but had another project where the 64MHz is very handy.
Thanks Ryan
$25 SMT Stencils!!!
www.ohararp.com/Stencils.html

rmteo
Posts: 237
Joined: Fri Feb 29, 2008 7:02 pm
Location: Colorado, USA

Post by rmteo » Sun Jan 25, 2009 6:24 pm

Thanks for letting us know, Ryan. I use a PIC18F44K20 (see previous page) with one of the tiny MURATA CSTCE 16MHz SMT ceramic resonators and it works a treat. :D

Toley
Posts: 32
Joined: Tue Nov 20, 2007 5:47 pm
Location: Canada

Post by Toley » Sun Jan 25, 2009 9:04 pm

Hi Ryan, I've used the 46k20 with Steven's SD Library but in Proton.

At 64MHz it didn't work with hardware SPI clock/4. I must set the MSSP Clock/16 to make it work.

Maybe this could help you.

liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

Post by liak » Fri Jan 30, 2009 12:51 am

Dear Toley,
Thanks for the info. I will be trying to use Steven's SD library as soon as I get my hands on my 26K20. I am hoping to drive it to MSSP clock/4 initially, :( but now since your earlier experience with the other brothers of the chip failed to push it to that limit, I guess 26K20 may also be having same issue.

Further question to you regarding your settings:
Have you tried software SPI? Did it work? Could the SSPI transfer rate be faster than MSSP clock/16? Have you been able to tail down to why it fail? Would be glad if you could give some clues. I have screen through the SD help file benchmark, it says this:
Manufacturer Type Size SD_SPI Clock SPI Speed Write 1 MB Read 1 MB Result
IT Works SD 64 MB MSSP 32 MHz PLL spiOscDiv4 15.21 sec 17.90 sec Success
byteStor SD 128 MB MSSP 32 MHz PLL spiOscDiv4 15.73 sec 16.28 sec Success
Integral SD 128 MB MSSP 32 MHz PLL spiOscDiv4 15.15 sec 16.26 sec Success
Toshiba MicroSD 256 MB MSSP 32 MHz PLL spiOscDiv4 19.67 sec 15.88 sec Success
Toshiba SD 512 MB MSSP 32 MHz PLL spiOscDiv4 17.37 sec 15.54 sec Success
Kingston SD 50X 1 GB MSSP 32 MHz PLL spiOscDiv4 17.22 sec 15.63 sec Success



Manufacturer Type Size SD_SPI Clock SPI Speed Write 1 MB Read 1 MB Result
IT Works SD 64 MB SW 40 MHz - 22.58 sec 28.38 sec Success
byteStor SD 128 MB SW 40 MHz - 23.10 sec 24.64 sec Success
Integral SD 128 MB SW 40 MHz - 22.55 sec 24.64 sec Success
Toshiba MicroSD 256 MB SW 40 MHz - 27.05 sec 23.17 sec Success
Toshiba SD 512 MB SW 40 MHz - 24.64 sec 22.31 sec Success
Kingston SD 50X 1 GB SW 40 MHz - 24.55 sec 22.13 sec Success



Manufacturer Type Size SD_SPI Clock SPI Speed Write 1 MB Read 1 MB Result
IT Works SD 64 MB MSSP 40 MHz PLL spiOscDiv64 - - Fail
byteStor SD 128 MB MSSP 40 MHz PLL spiOscDiv64 - - Fail
Integral SD 128 MB MSSP 40 MHz PLL spiOscDiv64 - - Fail
Toshiba MicroSD 256 MB MSSP 40 MHz PLL spiOscDiv64 30.41 sec 28.35 sec Success
Toshiba SD 512 MB MSSP 40 MHz PLL spiOscDiv64 - - Fail
Kingston SD 50X 1 GB MSSP 40 MHz PLL spiOscDiv64 27.89 sec 26.88 sec Success
I have used a 18F2525 on SanDisk 1Gb running on settings MSSP 40Mhz PLL spiOscDiv4. It works fine, where it says above the Kingston counterpart failed. Does this depend on the manufacturer of the SD card as well? Which did you use?

Regards,
Liak

Toley
Posts: 32
Joined: Tue Nov 20, 2007 5:47 pm
Location: Canada

Post by Toley » Fri Jan 30, 2009 1:45 am

Hello Liak,
Like I said in my previous post, I used Proton version of SD File System. I did not try SF version yet. With MSSP clock/4 the card don't initialise at all. But just like you said, I used the software SPI and it look faster or even as fast as MSSP clock/16. I don't have any tools to measure transfer speed or actual clock speed.
Physical Layer Simplified Specification Version 2.00

• Default mode: Variable clock rate 0 - 25 MHz, up to 12.5 MB/sec interface speed (using 4
parallel data lines)
• High-Speed mode: Variable clock rate 0 - 50 MHz, up to 25 MB/sec interface speed (using 4
parallel data lines)
So at 64MHz/4 it should be inside the limits.

The cards I use are very cheap ones. Maybe it is why they don't work at high speed. But I ever made them work with a 18F4520 @ 40MHz with MSSP clock/4.

Let us know your results when you'll get your chips.

User avatar
ohararp
Posts: 194
Joined: Tue Oct 03, 2006 11:29 pm
Location: Dayton, OH USA
Contact:

Post by ohararp » Fri Jan 30, 2009 2:11 pm

I totally didn't think about the SW option. I'll have to try and give that a whirl.

FWIW I always use SD_SPI_SPEED = spiOscDiv4 in the SF library for the MSSP speed.
Thanks Ryan
$25 SMT Stencils!!!
www.ohararp.com/Stencils.html

nigle
Registered User
Registered User
Posts: 36
Joined: Tue Aug 12, 2008 3:13 pm
Location: West London

Post by nigle » Fri Jan 30, 2009 3:14 pm

ohararp wrote:I totally didn't think about the SW option. I'll have to try and give that a whirl.
It worked for me with an 18F67J50. Using MSSP, it wouldn't work at any speed.

This was with a micro SD card, support for SPI mode is optional for these but as it came with an adapter for full size then I figured that it would have to implement it.

Toley
Posts: 32
Joined: Tue Nov 20, 2007 5:47 pm
Location: Canada

Post by Toley » Sat Jan 31, 2009 12:05 am

I have now made some test with Swordfish SD Library and a PIC18F26K20. And I get exactly the same result, the card don't initialize at 64MHz.

Here are the details. I did not wrote any code, I used Steven's Sample Code 1 :

http://www.sfcompiler.co.uk/wiki/pmwiki ... ampleCode1

I did not used internal oscillator, I only used real crystal with PLL enable HSPLL (10, 12 and 16 MHz).

With SD_SPI_SPEED = spiOscDiv4 the card initialize at clock = 40, 48 but not at 64.

With SD_SPI_SPEED = spiOscDiv16 the card initialize at all frequencies.

Maybe someone else could do the test to confirm my results.

liak
Registered User
Registered User
Posts: 195
Joined: Fri Oct 05, 2007 12:26 am

Post by liak » Sat Jan 31, 2009 12:13 am

Dear all,

Thanks for the feed back. Can't wait to test it out. Ohararp, hope you can let us know what is the outcome of your test.

Regards,
Liak

Post Reply