CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

18f452 to 18f4520 migration problem (SPI/SD Card)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








18f452 to 18f4520 migration problem (SPI/SD Card)
PostPosted: Sat Apr 05, 2008 5:14 pm     Reply with quote

Hi all!

I have a program using SPI to read data from an SD card which works perfectly on a pic18f452. I changed for a 4520 and am now using the internal oscillator with PLL (32Mhz) instead of an external 20Mhz crystal.

I changed the code to initialize the PIC, and the PIC indeed works at the right frequency, but the SD card part is no longer working.

I did not found any informations on the migration documents from microchip relative to SPI.

Does anyone have an idea what could cause this?
Are there things I missed in the migration docs?

Thanks
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sat Apr 05, 2008 7:31 pm     Reply with quote

Does the SD card work when you select a lower clock frequency? For example the 16MHz with internal oscillator should be easy to check as it requires only a software change.
Guest








PostPosted: Sun Apr 06, 2008 4:48 am     Reply with quote

I tried soldering a 20Mhz crystal and setting config back to what it was originally, but it didn't change anything...
Guest








PostPosted: Sun Apr 06, 2008 5:56 am     Reply with quote

Well finally it works...
It was no software problem, but hardware: There was a junction between one SPI wire and ground because of a small desolder bread wire stuck in....

Thanks for trying to help though!
csuszo



Joined: 01 May 2008
Posts: 1

View user's profile Send private message MSN Messenger

Please help me
PostPosted: Thu May 01, 2008 7:59 am     Reply with quote

I'm having troubles to set my intosc on 32MHz can you help me how did you do that?
nicorosen



Joined: 25 Oct 2010
Posts: 2

View user's profile Send private message

PostPosted: Sat Nov 27, 2010 2:23 pm     Reply with quote

csuszo, I'm using a PIC18F4520 with internal oscillator @ 32MHz.
All you need is to set the fuses and configure the clock.
This is the code I used and worked well:


Code:

#INCLUDE <18F4520.h>
#FUSES INTRC_IO,NOWDT,PUT,NOWRT
#USE delay(internal=32mhz)
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group