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.

two different codes but no file??

Status
Not open for further replies.

MrDEB

Well-Known Member
Tried locating a file INTOSC8.bas
Does one have to make this them selves or is it in some where I have yet to look for??
be80be posted some code with
INCLUDE "INTOSC8.bas"
playing with an LED PWM (simulating a burning candle) that calls for same file
?????????????
 
Lol All you do is open up note pad paste this code in it and save as all files with the name
INTOSC8.bas to your swordfish user library
Code:
Module IntOSC8

OSCCON = $72
I bet I posted this more then 1 time LOL
The only reason you need it is because your using the beloved 18f1320 and for some reason when you write code it will not let you set the osc up at the start of your
code mostly if your using swordfish modules. And what happens is you'll think your code is not running because it running so slow you can't see any thing happen. this fixes that
 
Last edited:
Lol All you do is open up note pad paste this code in it and save as all files with the name
INTOSC8.bas to your swordfish user library
Code:
Module IntOSC8

OSCCON = $72
I bet I posted this more then 1 time LOL
The only reason you need it is because your using the beloved 18f1320 and for some reason when you write code it will not let you set the osc up at the start of your
code mostly if your using swordfish modules. And what happens is you'll think your code is not running because it running so slow you can't see any thing happen. this fixes that

Seems kinda' silly to have a seperate file with that one line in it. Surely there's a work-around for this problem, isn't there?
 
Seems kinda' silly to have a seperate file with that one line in it. Surely there's a work-around for this problem, isn't there?
You think there would be but even the man who wrote swordfish said that's the only fix he knows for it
The above shows how an 18F1320 is configured for an 8MHz internal clock. However, there is a problem. Many Swordfish modules have initialisation code which is executed before the main program block starts to run. The line

OSCCON = %01110110

will not be set until the module initialisation code has completed. For some modules (such as LCD) the initialisation code is quite substantial - OSCCON needs to be set before any module initialisation code is executed.

To ensure this happens, create a module called 'intosc.bas' and place in your 'UserLibrary' folder. For the 18F1320, the module code would look like this
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top