SDFS on 18F46K22


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: SDFS on 18F46K22

    ok, just for fun, i set the tris register manually i now get a different error...
    FAT_ERROR = 6, SDC_STATUS = 1 and SDC_RESPONSE = 255

    EDIT:
    I can also confirm i have it wired correctly fo MOSI / MISO

    MISO led is flashing as well as CLK and CS. but MOSI is not which tells me the pin from the chip is high.... ????
    Last edited by comwarrior; - 13th July 2012 at 00:59.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: SDFS on 18F46K22

    SDC_UseHardSPI = TRUE
    Change that to FALSE to test if it is a SPI problem. If it work then you can probably guess the problem is outside of the PIC, connections, bad SD card...
    Dave
    Always wear safety glasses while programming.

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: SDFS on 18F46K22

    hardSPI to false works it reports OK...

    so, am i right in thinking it's the configuration of the hardware SPI on the 46K22?

    I'm going to grab a 4550, and copy the test program and set it for the 4550 to see if it's a register issue.
    Any more help appreciated.

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: SDFS on 18F46K22

    hardSPI to false works it reports OK...

    so, am i right in thinking it's the configuration of the hardware SPI on the 46K22?

    I'm going to grab a 4550, and copy the test program and set it for the 4550 to see if it's a register issue.
    Any more help appreciated.

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: SDFS on 18F46K22

    after tinkering and remembering why i moved away from the 4550 (LCD problems)
    I got the card to initialise in both software and hardware mode on the 4550...

    I'm wondering if the 46K22 is too fast at 64MHZ? simple answer is to slow it down in the config...

    I have noticed on the 4550 the SPI LED pullups behave completely diferently between softwar and hardware modes...

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: SDFS on 18F46K22

    right, i dropped the 46K22 to 8MHz and the hardwareSPI now works...
    so... now we need to work out a way of slowing the SPI bus down for initialisation...

    EDIT: works at 16MHz
    EDIT2: works at 32MHz with PLL enabled (8MHz x 4)
    Last edited by comwarrior; - 13th July 2012 at 16:08.

  7. #7


    Did you find this post helpful? Yes | No

    Default Re: SDFS on 18F46K22

    ok, i have tried everything to get the SPI to work at 64MHz...
    I tried using SSP1ADD for the baud rate generator and it locks up the chip if you use a value above 170 ish...
    I tried using TMR2 with it's highest per and post scalers... same effect...

    I looked at the datasheet for the baud rate generator, it give a table for speeds...
    It give values for OSC upto 32MHz but not 64MHz...

    It looks like the 46K22 has an issue running stuff at 64MHz because so far I've had to write work arounds for ADC and HWPWM to operate at 64MHz... BUT the EUARTS seem to be ok at 64MHz so, i don't get it... did microchip not test this chip properly at 64MHz or something...
    Luckily, i think i can get away with 32MHz...

    thanks for all the help

  8. #8
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: SDFS on 18F46K22

    Have you tried dividing down the SPI clock? SSPxCON1 register allows you to select three different ratios.

    /Henrik.

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts