|
|
View previous topic :: View next topic |
Author |
Message |
John0815 Guest
|
PIC18LF4550 - Mass Storage Device |
Posted: Sun Jul 05, 2009 6:04 am |
|
|
Hi everybody!
I'm a bit in trouble at the moment and I hope you can probably help me.
I've been using a PICLF4620 so far, but I changed it to a LF4550, as mentioned in the subject.
Problem #1: I use the old board and reconnected the pins of the SD card (SCL, SDA, SDO; CE remained the same) and the mini USB (D+/-, V_USB). Are there any additional resistors/capacitors necessary?!
Problem #2: I use the CCS C compiler and can use the old code except one line:
Code: | setup_adc(ADC_CLOCK_INTERNAL|ADC_TAD_MUL_0); |
This is because ADC_TAD_MUL_0 is not defined in the PIC18F4550.h header file. This code belongs to a sensor and is probably the reason why my system doesn't work anymore?! Or is it because of the schematics that have a mistake anywhere right now?
Problem #3: The main problem. I want to use the SD Card on the board via the USB as a Mass Storage Device on a PC. Data only gets written from the µC to the SD card and should only be read on the PC. I've read something of a firmware update and so on, but to be honest I don't know how this actually works?! I found a few files, but I'm not sure which is the right one AND all of them are not for CCS C?! Did anyone of you have a similar project with the 4550 and a SD card? Does anyone of you have a working firmware for CCS C? Maybe there's a tutorial anywhere?!
I hope you can help me because I'm a bit frustrated in between. Sorry for my stupid questions, but I'm not such a expert on that topic. Thanks a lot in advance! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jul 05, 2009 3:30 pm |
|
|
Quote: |
I've been using a PICLF4620 so far, but I changed it to a LF4550.
Problem #1: I use the old board and reconnected the pins of the SD card
(SCL, SDA, SDO; CE remained the same) and the mini USB (D+/-,
V_USB). Are there any additional resistors/capacitors necessary?! |
On the 18F4550, pins C4 and C5 are dedicated to the USB. They don't
have any SPI functions available on them. The 18F4550 is not pin-
compatible with the 18F4620. You can't just drop it in as a replacement
chip in the same circuit.
Quote: |
setup_adc(ADC_CLOCK_INTERNAL|ADC_TAD_MUL_0);
ADC_TAD_MUL_0 is not defined in the PIC18F4550.h header file.
|
Then just delete that parameter from the setup_adc() statement.
Also, instead of using ADC_CLOCK_INTERNAL it's better if you use the
correct ADC divisor, based upon your PIC oscillator frequency. Look in
the ADC section of the PIC data sheet. They always have a table that
shows the correct divisor value for your oscillator frequency.
Quote: |
I've read something of a firmware update and so on, but to be honest I
don't know how this actually works?! I found a few files, but I'm not sure
which is the right one AND all of them are not for CCS C?! |
Tell us where you are looking, when you see these files ?
Is it from the CCS USB developement package, which can be
downloaded from this page, if you have current maintenance ?
http://www.ccsinfo.com/compilerupdates.php
If so, some of the source files are for Windows applications and are
written in Delphi. |
|
|
|
|
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
|