Page 1 of 2

SD e-block

Posted: Wed Aug 29, 2012 10:47 pm
by proton
Hi,

You show a example of playing a wav file from a sd card e-block, but can you give me some more info

1. the chip config in example is shaded out, what is the clock speed (internal,rc,xtal)
2. the sound output is on what pin (pwm)
3. what input is card reader on
4. what kind of circuit did you use to play the sound
5. what is the jumper position on the board as could not see the ic listed

looking forward to your reply

Re: SD e-block

Posted: Thu Aug 30, 2012 10:24 am
by Enamul
Hi,
1. the chip config in example is shaded out, what is the clock speed (internal,rc,xtal)
The example 7. Streaming a WAV file using PWM to play audio uses ECIO-40 where 48MHz clock was used as system clock. But you can use the same code with 4 to 48MHz external clock source with PIC18f4455. You can tell us which PIC you are going to use and which programmer or development board you are using.
2. the sound output is on what pin (pwm)
The example uses channel 1 as PWM output which is connected to RC2 (PIN17 of PIC18f4455 but PIN 29 of ECIO-40).
3.what input is card reader on
Card reader has following connections:
Chip select>>PORTA<2>
Clock >>PORTA<3>
Data In >>PORTA<4>
Data Out >>PORTA<5>
4.what kind of circuit did you use to play the sound
As this is audio signal any simple audio driver using transistor from RC2 which will drive a speaker is enough to play the sound..
5. what is the jumper position on the board as could not see the ic listed
http://www.matrixmultimedia.com/resourc ... 7-30-1.pdf
I can see the IC list with jumper position here in the above datasheet...which pic you intend to use..please let us know.

Re: SD e-block

Posted: Thu Aug 30, 2012 11:13 am
by proton
I was going to use a PIC16F877/A with it's internal clock on a EB006 development board using Flowcode 4, there a limit to the size of memory card or class

Re: SD e-block

Posted: Thu Aug 30, 2012 11:17 am
by Enamul
Actually You can't use PIC16f877a for SD card due to it's RAM size..Better to move to PIC18f4455 with 20MHz external clock and EB006 is fine..
You can follow following Ben's post.
http://www.matrixmultimedia.com/mmforum ... =26&t=4850

Re: SD e-block

Posted: Fri Aug 31, 2012 8:57 am
by proton
1

Re: SD e-block

Posted: Fri Aug 31, 2012 10:58 am
by Benj
Hello,

Please try this example instead. It uses the FAT component rather then a custom component.

Re: SD e-block

Posted: Fri Aug 31, 2012 11:04 am
by Enamul
Hi,
Although what Ben's post is right one for ECIO-40 but if you are using PIC18f4455 with 20MHz external clock you should use the attached file..We have recently tested this one which seems to have right config for PIC18f4455.

One suggestion for posting the error, it's better to post the msg file in achievement which is in the same folder of your .fcf file. It saves space of the post and looks better.

Re: SD e-block

Posted: Fri Aug 31, 2012 12:37 pm
by proton
Hi,

Can iuse a 19.6608 Crystal ? thats all i got at hand at the moment. Because at present i'm using that crystal and getting the following on the LCD

Opening file
File Error: 239

Rgds

Wayne

Re: SD e-block

Posted: Fri Aug 31, 2012 1:36 pm
by Benj
Hi Wayne,

We have had reports that a 19.6608MHz crystal will work with the 18F4455 family to get a clock of around 48MHz and this is stable enough to run the USB components. Simply change the PLL crystal value in the chip configuration to 20MHz and it should work ok.

Re: SD e-block

Posted: Fri Aug 31, 2012 2:12 pm
by proton
Hi

What is PLL ? is it a internal clock ? and how do i change it

Thanks for your help

Rgds

Wayne

Re: SD e-block

Posted: Fri Aug 31, 2012 2:32 pm
by Benj
Hi Wayne,

PLL (phase locked loop) is a clock frequency multiplier, it takes your input clock frequency and converts it up into a high frequency to drive the primary oscillator at 48MHz allowing for a system clock speed of 12MIPs which is compatible with full speed USB.

To change the PLL settings for the 18F4455 family simply change the "OSC Select" config setting to match your crystal. "div by 5 {20MHz input}" for your 19.6608MHz crystal.

This article contains details of how to setup the config settings for these devices.
http://www.matrixmultimedia.com/resourc ... %20PIC.pdf

Re: SD e-block

Posted: Fri Aug 31, 2012 3:18 pm
by proton
Hi,

Still getting message LCD

Opening File
File Error: 239

Any advise

Rgds

Wayne

Re: SD e-block

Posted: Fri Aug 31, 2012 3:52 pm
by Enamul
Hi,
Can you post your program please? Also a bit details about your problem..

Re: SD e-block

Posted: Fri Aug 31, 2012 4:04 pm
by proton
Hi,

its the example program you sent me, please check chip config on my program

using EB006 Board with a 19.6608 Mhz
EB037 with jumpers on "A" and 5V and 16M MMC Card

Thanks

Wayne

Re: SD e-block

Posted: Fri Aug 31, 2012 4:49 pm
by Benj
Hi Wayne,

The CPU Sys CLK Select should be set to No Divide. You can also probably disable the fail safe clock monitor.

Other then that everything looks ok.

If you want to confirm on hardware then perform the simple 1 second flasher test.

What about trying the FAT component on PortD, I believe there may be some complexity with some of the PortA pins which can cause problems.

Re: SD e-block

Posted: Thu Sep 06, 2012 3:29 pm
by proton
Hi,

Still having problems now it will not ID the chip when compiling or clicking on auto detect. Place a 16f877 in the ic socket and it see's it no problem, changed it with a new 18f4455 and i get " Could not ID onboard chip "

Any ideas

Wayne

Re: SD e-block

Posted: Thu Sep 06, 2012 4:44 pm
by Enamul
Hi,
Do you have any other module connected in PORTs especially PORTB? please remove all modules from ports and try to detect PIC18f4455.

Re: SD e-block

Posted: Fri Sep 07, 2012 11:51 am
by Benj
Hello,

It might also be worth playing around with these options in PPP to see if any of these help.

Re: SD e-block

Posted: Fri Sep 07, 2012 4:04 pm
by proton
Hi,

OK i have load a program to the 4455 ic that just prints "HI" in one second intervals to the LCD , but when loaded to the hardware it takes 20 seconds to repeat the message. i think this is the problem but how do i solve it to get the timing correct

Rgds

Wayne

Re: SD e-block

Posted: Fri Sep 07, 2012 4:30 pm
by Benj
Hi Wayne,

Check your clock speed and configuration settings are correct for your hardware in the project options and the delays should start working correctly.

If your in doubt then attach your program to the forums and detail the setup of your hardware. eg what crystal speed etc.

Re: SD e-block

Posted: Fri Sep 07, 2012 4:46 pm
by proton
Its a 20 Mhz crystal (i also tried a 19.6608) on a EB006 development board and used the setting from emanuel program and also tried to adjust them but nothing seem to change ???

Re: SD e-block

Posted: Fri Sep 07, 2012 5:20 pm
by Enamul
Hi,
Can you please post the program so that we can see whether you have changed correctly or not?

Re: SD e-block

Posted: Sat Sep 08, 2012 10:20 pm
by proton
Hi,

I am now a step closer, the card was not formatted right. But the only problem now is i only get about 2 seconds of sound then it locks up and all i get is a hiss or a looped noise like a dirty cd . any ideas ?

Thanks for your help so far

Wayne

Re: SD e-block

Posted: Mon Sep 10, 2012 2:41 pm
by proton
hI

Please find attached program

regards

Wayne

Re: SD e-block

Posted: Mon Sep 10, 2012 3:31 pm
by Benj
Hi Wayne,

Have you tried doing a full format of the SD card (not a quick format) and then putting the wav file on the card.

Is the problem cyclical eg it comes and goes or once the corruption has been reached is that it?

Does the EOF marker come up on the LCD at all?

I have recently made numerous fixes to the FAT component for v5 to try and speed up the access speeds and to help the calculations work correctly with larger addresses. Saying this I did have a WAV player working nicely in v4 using this chip so it should work. Is the sample rate on your wav file ok? eg 8KHz 8-bit mono?