
Originally Posted by
malc-c
I've been trying to get a couple of addon boards for my EasyPIC5 board running, both of which use SPI. Not having worked with this before, could someone tell me if this is clock specific. I've tried using 4,6,10,12, Mhz crystals, and HS_PLL to x 4 (16,24,40,48 Mhz running speeds) but the examples found on the web (MikroElectronika) just won't play ball with the 18F4520. The only crystal I've not tried is an 8Mhz (32Mhz running speed).... but then the examples imply it should still work with a 10Mhz one ?
I would ask on the Mikrobasic forum, but it seems that as I'm new, each post still goes through the approval stage - so it takes 2 days to post 2 messages - and I know you guys here as really helpful and very knowledgeable

The instructions on the file say to use a 8mhz crystal. If you are using the hex file, then yes, it would be clock specific for rs-232 serial interface.
Code:
' *
' * Project name:
' Mmc_Test (MMC Library Example)
' * Copyright:
' (c) Mikroelektronika, 2010.
' * Revision History:
' 20081016:
' - initial release;
' 20101110:
' - active comments added, minor code and comments modifications;
' * Description:
' MMC library test. Upon flashing, insert a microSD card into the
' module, when you should receive
' the "Init-OK" message. Then, you can experiment with MMC read and write
' functions, and observe the results through the Usart Terminal.
' * Test configuration:
' MCU: PIC18F4520
' http://ww1.microchip.com/downloads/e...Doc/39631E.pdf
' Dev.Board: EasyPIC6
' http://www.mikroe.com/eng/products/v...opment-system/
' Oscillator: HS-PLL, 8.00000 MHz
' Ext. Modules: microSD CARD board
' http://www.mikroe.com/eng/products/v...sd-card-board/
' ac:microSD_CARD_board
' SW: mikroBasic PRO for PIC
' http://www.mikroe.com/eng/products/v...c-pro-for-pic/
' * NOTES:
' - Connect microSD Card to PORTC and turn on PIC switches on it (switches 1,4 and 6).
' Put supply select jumper in 5V position.
' - Connect RS232 cable and turn on RS232 switches SW7.1 and SW8.1 (board specific).
' - This is NOT an example for working with FILES on a microSD memory module.
' *
Bookmarks