[SOLVED] PIC complete discussion for all

Status
Not open for further replies.
wow awesome!!! I will also do that... hehe


Any other challenges, up your sleeve?

I will ask you for sure If I encounter another one.. hehe

thanks...

I have now my PIC18f4550 and tomorrow I will try to blink a LED in actual hardware... hehe
 
Last edited:

This forum really a valuable. It's like a classroom, students sharing thoughts, their knowledge and understanding to any topic discussion.

yes... for this is more than a class room...

I learn a lot and directly here compared to school... hehe
 

What Fosc are you going to run the PIC18F4550? The same Fosc as your PIC16F or higher?
 

i have only 20Mhz crystal here..

Actualy im learning to read and write to mmc/sd card because later if i know how then i will try to stream a wave file from card. I want to make simple music player.

That is why im learning basics of pic little by little.

Im hoping that i can do that project. Hehe
 

Ok,

Well here's a similar PIC18F/WAV project you may find of interest:

PIC18F SD WAV Audio Player

You may also want to consider off loading the decoding to a peripheral decoding device, for better performance and MIDI capabilities as well:

Breakout Board for VS1103 MIDI Decoder

Interesting project, keep me posted as to your progress.

Ciao
 

sure. Sure. For now i will not use any module but that will be the next part i will add for enhancement purposes.

Yes, its interesting project for me if ever this is done it will will inspire me more if i hear the music comes from my project. Hehehe

---------- Post added at 02:38 ---------- Previous post was at 02:27 ----------

by the way is it possible to do this project using 20mhz crystal? The max clock would be 20/4 =5Mhz right?

I think it would be better if i maximize my clock. Hehe i dont know.

---------- Post added at 02:40 ---------- Previous post was at 02:38 ----------

we have now a whole day power interruption here. Huhuhu i cant start working this day. Im on mobile.
 

by the way is it possible to do this project using 20mhz crystal? The max clock would be 20/4 =5Mhz right?

I think it would be better if i maximize my clock. Hehe i dont know.

Actually using a 4MHz crystal the PLL can generate up to a 48MHz Fosc, which I believe is the maximum clock for the 18F4550. Maximum Fosc, clock, would be vital for audio applications.

we have now a whole day power interruption here. Huhuhu i cant start working this day. Im on mobile.

Wow, that must be frustrating! What do you do when the cell phone battery dies? Can you charge it in a vehicle?
 

Wow, that must be frustrating!
What do you do when the cell
phone battery dies? Can you
charge it in a vehicle?
nope. i dont have a car

Actually using a 4MHz crystal the
PLL can generate up to a 48MHz
Fosc,
i dont understand this. I thought we can achieve max clock by using external 48mhz crystal. I cant get exact explaination about that PLL Thing in google how to use that.

Yes. The max clock is 48Mhzcant get exact explaination about that PLL Thing in google how to use that.

Yes. The max clock is 48Mhz.
 
Last edited:

PLL - Phase Locked Loop:

Phase Locked Loops (PLL)
circuits are used for frequency
control. They can be
configured as frequency
multipliers, demodulators,
tracking generators or clock
recovery circuits. Each of
these applications demands
different characteristics but
they all use the same basic
circuit concept.




I have additional information if you want it.
 

is that an external clocking circuit? I cant browse properly here in mobile. I will surely search about that soon.

---------- Post added at 04:47 ---------- Previous post was at 04:38 ----------

battery is dead. better to sleep now. Hehe
 

is that an external clocking circuit? I cant browse properly here in mobile. I will surely search about that soon.

No,

The PIC 18F4550 has a PLL incorporated into its design. By using an external 4MHz crystal or the device's internal oscillator, a Fosc/Clock frequency of 48MHz can be generated.

Reference: PIC18F4550 Datasheet, pg 27, 2.2.4 PLL FREQUENCY MULTIPLIER

PIC18F2455/2550/4255/4550 devices include a Phase
Locked Loop (PLL) circuit. This is provided specifically
for USB applications with lower speed oscillators and
can also be used as a microcontroller clock source.


PIC18F4550 Datasheet

The information to setup the PLL is contained in the datasheet as well.

Hope your power comes back on.

Ciao
 
This is from the datasheet:

This clearly tells you of the PLL incorporated in the PIC18F4550.
Read the datasheet carefully and for more information, there's always Google! :grin:

Hope this helps.
Tahmid.
 
Hope your power comes back on.

ok Im back.. it's getting late



96Mhz clock? It's fast than I expected. from the MMC manual I have read that during operation we need to lower the clock up to 400Khz. I think in the initialization part of MMC(not sure) and switch to higher clock during read/write. so How do I reach that clock rate if my system is running very fast at 96Mhz? and the available postscaler are 1/2, 1/3, 1/4 and 1/6..I think I cant get lower up to 400Khz in this mode.. not sure just my idea... hehe




This clearly tells you of the PLL incorporated in the PIC18F4550.
Read the datasheet carefully and for more information, there's always Google!
sad to say Power here just resumed that's why I cant ask google properly
 


The actual maximum Fosc or system clock is 48MHz, due to the postscaler options of which the 1/2 is the small divisor. In other words 96MHz divided by 2 is 48MHz, the stated maximum Fosc in the devices datasheet.


Glad your power is back up.
 
from SD card SPI mode manual:

During the reset state, the card clock frequency should be between 10–400 KHz. After the reset
state, the maximum clock frequency can be increased to 25 MHz (20 MHz for the MMC).
3.18 Summary

I think I cant use the PLL because even I use the largest scaler the clock still 98*1/6 = 16Mhz.... Am I correct? hehe
 

Actually the 400kHz you are referring to is the SPI interface clock, not the Fosc or system clock.

Reference PIC18F4550 Datasheet, pg 197, 19.0 MASTER SYNCHRONOUS SERIAL PORT (MSSP) MODULE


Different clock, details of configuring the SPI interface are contained in the section reference above in the datasheet. Basically there nothing to be to concerned about, you can run a 48MHz Fosc and still use the SPI interface if it is properly configured.
 
Actually the 400kHz you are referring to is the SPI interface clock, not the Fosc or system clock.
okay I think I got it..





page 197. MSSP module:


let say for example:
if I use PLL then use 1/6 scaler I will get 16Mhz system clock(96*1/16).
to be able to reach the max of 400Khz during on reset of SD card in SPI mode I will configure my SPI to run at FOSC/64 to have 250Khz speed for SPI during initialization.. I hope I am corect.. hehe

---------- Post added at 14:14 ---------- Previous post was at 14:09 ----------

the link you have posted is awesome... hehe the project file is also there and the hex file... hekhekhkehe lol


**broken link removed**

---------- Post added at 14:17 ---------- Previous post was at 14:14 ----------

The author of this project is from Philippines.. I can Understand the backgroud noise in this video... hehe it's my language... hehe lol

---------- Post added at 14:21 ---------- Previous post was at 14:17 ----------

The audio of this project has a lot of noise.. In that part where can we enhance the audio part? I think in the hardware part..
 

Yes and No.

You will need to setup the Fosc for 48MHz due to the audio decoding requirements, the project blog actually discusses this point.

Attached is the source code, download it, if you have not already and study it, particularly the main.c which contains the setup of the Fosc and spi_pic18.c and the associated header file.

They should give you some insight as to how to setup the SPI interface and Fosc. I believe the project uses a 20MHz Crystal, but similar results should be achieve with a 4MHz Crystal.
 

Attachments

  • PIC18 SD WAV Audio Player.rar
    479.1 KB · Views: 94
I have lost track of the thread but if i scroll back.... Interfacing SD card is too early for romel... maybe you may have do a ot of basics program and develop sd card once you are familiar with SPI..... Going too fast is also tooo bad... i dont see any point in giving you so many advanced topic source code so soon by other members.....

If you have asked for it .. but i feel a slow approach is always good, and i wonder how some of the experienced people missed to tell you and are helping you....

I am not harsh nor degrade your learning speed.. but learn slowly, as there is no hurry to finish things.......
 

actually your correct.. but I will do it slowly(my style).. my first target is just to do simple read/write in sd card.. the wav player is for the future.. hehe

I have some of the information, source code and e-books here about sd card interfacing all I need is to study this things... Honestly I dont understand this all but I have only a very little idea which I know I can develop this in the near future...

---------- Post added at 14:54 ---------- Previous post was at 14:51 ----------

I have a source code here to write a simple txt file to sd card but I want to understand this whole thing why it is written like this... I will study all this stuff chunk by chunk..
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…