Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help needed with osc setting on 30f4013

Status
Not open for further replies.

large_ghostman

Well-Known Member
Most Helpful Member
hi, sorry if this post rambles a bit but i want to make sure i give the details! first i have looked and worked hard to try and sort this myself but now i am at the point where i am out of ideas and going in circles, so let me explain.

on say the 18f4685 chip, when you do the pragma setting for the OSC you can set it to use the internal OSC and have the OSC2 pin as a CLK output, so you can use a oscilloscope on the pin and you can see the internal clk frequency by x4 the oscilloscope frequency on the OSC2 pin.

i am using the 30f4013 chip and i wanted to do the same setup, but i cant seem to find how to set it, i have looked in both the datasheet and familly ref sheet and the device H file, i will post screen shots so you can see the sections and i will explain why i am confused.

first off the OSC section of the datasheet starts on page 133 and it comes under the system integration section! (took me ages to find it as i was expecting it to have it's own section!)
osc settings.png
osc settings.png
osc settings.png

i should point out that at the moment i am setting fuses by the config menu in MPLAB and not by pragma directive
anyway i am using FRC setting wich gives me (approx)8Mghz internal clock, but i am convinced its not running at correct speed hence why i want to chk it using OSC2pin,
now the second pic shows the next table in the datasheet
osc table2.png
osc table2.png

from that you can see that for my setting it says
Note 1:
OSC2 pin function is determined by (FPR<4:0>)
now first problem i cant find FPR in the mplab watch window or under SFR in MPLAB so question 1 is how to you view how the bits are set for FPR when debugging?
AHHHHHH wait a min!! i was about to post a screen shot from the family ref sheet and from the device H file BUT, maybe i have the answer staring at me! on the table ive noticed this

ERC External RC oscillator, OSC2 pin is FOSC/4 output(3)

although i am using FRC in the H file ive noticed this under the FOSC fuses

_FOSC(CSW_ON_FSCM_OFF & FRC & ERC);
so to me it looks like i can use that setting and get internal CLK but FOSC/4 on the OSC2 pin.
now before i try this does anybody else agree with my reasoning??? reason i ask is i have already bricked one chip trying to set the fuses in software so i dont want to brick my last chip lol

i wont post all the stuff i was going to as i am pretty sure that is the answer but i would like it clarified :D
have speant 2 days trying to work it out but hopefuly i am almost there :D


.
 
sorry i keep getting message on pc saying shock whatever has crashed and image didnt post but clearly it did! so sorry for the duplicates!!
 
not sure mr Ian, BUT after dinner i have a couple of things to try! i have finaly worked out how to set the fuses in code! and what fuses do what, been all uphill but i might have got there! will have dinner then update :D
 
anyway didnt go well! another problem i now have is the board is acting like it has some kind of short (but not a dead short) the led indicator on the board has dimmed and the constant current limiter has kicked in on the psu! got a nasty feeling i have damaged the pic! not to worry still have another week holiday after this week so plenty time to get another and continue :D i am determined to have an article done in two weeks :D
 
Status
Not open for further replies.

Latest threads

Back
Top