SD File system 18F4550


+ Reply to Thread
Results 1 to 4 of 4

Thread: SD File system 18F4550838 days old

  1. #1
    Theotje
    Guest

    0 Not allowed!

    Default SD File system 18F4550

    I've been trying to connect an Catalex SD card to a 18f4550.

    All hard ware is connected as in the example from the link below;
    [HTML]http://www.protonbasic.co.uk/vbdownloads.php?do=download&downloadid=405[/HTML]

    I tested the shield and card on an Arduino UNO and got it to read/write.

    SD card information;
    Fat16 volume 16Gb.

    Compiling the example code in Protonbasic works as should after selecting the pre-compiler.
    Is there a forum member that has a working .hex file to share?
    This so i know for sure that the problem is in my hardware system.

    Are there extra setting that are needed when the project runs at 20Mhz and uses a bootloader for downloading the software in the 18f4550?

    Kind regards,
    Theo
    Last edited by Theotje; 19th December 2017 at 09:50.

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Theotje
    Guest

    0 Not allowed!

    Default Re: SD File system 18F4550

    I've been testing the hardware part of my project.

    As far as i can check the pin output/input its as expected by the code.

    Can the size of 16 Gb sd-card be the problem?

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Prolific Poster normnet's Avatar
    Join Date
    Jul 2004
    Posts
    2,392
    Thumbs Up
    Received: 79
    Given: 46
    Total Downloaded
    1.40 GB

    0 Not allowed!

    Default Re: SD File system 18F4550

    Quote Originally Posted by Theotje View Post
    I've been testing the hardware part of my project.

    As far as i can check the pin output/input its as expected by the code.

    Can the size of 16 Gb sd-card be the problem?
    I would first try a less unique PIC than the USB 18F4550 or look more into its specifics.
    Quote hadv215:
    By the way, no matter what the datasheet says, the 18F4550 only has 34 i/o pins. Pin 18, which is 'normally' RC3 in this layout, is Vusb.
    The smaller size cards are a bit different (older) spec but not sure at what GIG the change is from memory.

    Norm
    Last edited by normnet; 24th December 2017 at 15:41.

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Theotje
    Guest

    0 Not allowed!

    Default Re: SD File system 18F4550

    Thanks Normet for your reply. I've selected the 18f4550 because the example on this forum is also writen for that PIC.
    Also I have about 19 pieces in stock. The pin numbers i use are equal to the example.
    Below the code as i adjusted it till now;

    Device = 18F4550
    Declare Xtal = 20
    Declare Bootloader = On


    Optimiser_Level = 3


    Config_Start
    PLLDIV = 5 ; Divide by 5 (20 MHz oscillator input) Divide by 12 (48 Mhz oscillator input)
    CPUDIV = OSC1_PLL2 ; [OSC1/OSC2 Src: /4][96 MHz PLL Src: /6] osc1 / pll2
    FOSC = HSPLL_HS ; HS oscillator, PLL enabled
    PWRT = On ; PWRT enabled
    BOR = OFF ; Brown-out Reset disabled in hardware and software
    WDT = OFF ; HW Disabled - SW Controlled
    WDTPS = 1 ; 1:1
    MCLRE = OFF ; RE3 input pin enabled; MCLR disabled
    STVREN = OFF ; Stack full/underflow will cause Reset was on
    LVP = OFF ; Single-Supply ICSP disabled
    XINST = OFF ; Instruction set extension and Indexed Addressing mode disabled (Legacy mode)
    Debug = OFF ; Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins
    Config_End


    UCFG.3 = 1 ; uitschakelen van USB zodat PortC 4 & 5 als Input te gebruiken zijn


    '-----------------------------------------------------------
    All_Digital = TRUE
    '-----------------------------------------------------------
    Declare Hserial_Baud = 115000 'Setup RS232 port
    Declare Hserial_RCSTA = %10010000
    Declare Hserial_TXSTA = %00100100


    Declare Shift_DelayUs 65535
    '-----------------------------------------------------------
    Dim Response As Byte
    Dim SD_IO As Byte
    '-----------------------------------------------------------
    REM Fwd Symbol SD_CS = PORTD.2 ' CS
    REM Fwd Symbol SD_DI = PORTD.5 ' MOSI
    REM Fwd Symbol SD_CLK = PORTD.3 ' CLK
    REM Fwd Symbol SD_DO = PORTD.4 ' MISO
    'SS not attacht to SD-Shield Catalex
    '-----------------------------------------------------------
    Include "SDcard_Lib.pbp"
    '-----------------------------------------------------------
    GoTo Over_Sub 'Jump over the subroutines
    '-----------------------------------------------------------

    Over_Sub:
    DelayMS 200
    '-----------------------------------------------------------
    Main_Prog:
    HSerOut ["INSERT SD OR MMC",13]
    Repeat
    Response = SD_Init_FS
    Until Response = 0
    HSerOut ["OPENING FILE",13]
    SD_File_Name = "TEST001" 'File Name, upper case only!
    SD_File_Ext = "TXT" 'File Ext, upper case only!
    Response = SD_Open_File
    If Response = 1 Then
    HSerOut ["FILE NOT FOUND",13]
    Stop

    EndIf
    HSerOut ["FILE OPEN",13]
    While SD_EOF < 1
    Response = SD_Read_Byte_From_File
    HSerOut [Response]
    Wend
    '-----------------------------------------------------------
    Finish:
    HSerOut [13]
    HSerOut ["FINISHED",13]
    Stop

    I will try to get a smaller SD card for example about 4 Gb. Hope that will be the solution for my problem.
    That since i cant figure out why the SD_Init_FS is not writen to 0.

    Kind regards,
    Theo

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. SD File System revisited
    By AlbertoFS in forum SWright's Feedback Forum
    Replies: 13
    Last Post: 28th September 2019, 14:33
  2. [SOLVED !] Fat32 file system
    By bugi in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 11th November 2011, 00:42
  3. A SD File System Question
    By AlbertoFS in forum SWright's Feedback Forum
    Replies: 1
    Last Post: 17th March 2010, 12:43
  4. SD file system
    By dmTulsa in forum SWright's Feedback Forum
    Replies: 1
    Last Post: 14th March 2010, 17:59
  5. [SOLVED !] Question on SD File System
    By TEEGEE in forum Proton Plus Compiler v3
    Replies: 0
    Last Post: 26th November 2008, 21:59

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