ok
Let's say that I am going to use the code from 16f628 to blink a led in Porta.1
loop:
High PORTA.1 'Turn on LED
Pause 500 ' Delay for .5 seconds
Low PORTA.1 'Turn off LED
Pause 500 ' Delay for .5 seconds
Goto loop ' Go back to loop and blink LED forever
End
How I will use the internal osc?
In 16f628 i did this:
@ DEVICE pic16f628, INTRC_OSC_NOCLKOUT
Now it did not work.
What else it needs to work?
Nikos
How did you find out how to set the Internal Oscilator for the 16F628 ?
Presumably by looking in the datasheet for the device to see what needed to be configured.
By looking in the datasheet for any PIC you will be able to find what needs to be set. It may take a few tries before you get the correct results but that is how you learn....from your mistakes.
Also read the sections about Analogue Ports and Comparators.
Last edited by keithdoxey; - 16th June 2007 at 20:31.
Keith
www.diyha.co.uk
www.kat5.tv
What the heck happen on this forum since few weeks/months?
Guys, if you can't help, don't answer, don't waste your/our time and bandwith.
Even if this is a simple question, 18F4550 have tons of Configuration fuse to set. Can be enough to stop someone to use it.
There's really a lot of a s s kicking to do here
--------------------------------------------------------------------------
ngeronikolos,
have a look at the following, OK, it's more than a LED blink, but this should give you some hints at least about the config fuses settings.
http://www.picbasic.co.uk/forum/show...ght=pic18f4550
HTH
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Because...even without setting config registers (I suppose depending on the programmer and any previous settings that might be 'locked in'), the '4550 will start up (as most newer PICs will) with a 1Mhz internal clock (depending on the PIC model), not perfect, but enough to get things up and running... especially the ol' "blinky led" type program.
And...You and I both know that the '628 blinky led program wasn't going to work as expected in the earlier post since there is no mention of the ADCON CMCON registers. This is all mentioned in the PBP manual under section 2.5, which is labeled I've Got Troubles, where it specifically mentions the comparator and the analog ports, not to mention the issues with RA4, all of which seem to plague SOOOO many people. But that assumes that the person has a copy of the book.
And as far as the pins being configured as inputs on reset, the HIGH and LOW statement for the 'blinky led' program should take care of that.
Last edited by skimask; - 17th June 2007 at 00:01.
i know you wanted to say CMCON for the 16F628![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Except that the default config settings in the .INC files for these chips are for a 20Mhz crystal, using the PLL to get 48Mhz to both USB and CPU.Originally Posted by skimask
Maybe if you tell the programmer not to write the config settings it might .. stress might, come up with the internal oscillator, but NOT defining the required conditions, and hoping it does what you want, is obviously NOT the right way to do things.
And, while we're on the subject of the "right way to do things" ...
When someone asks a question on the Forum, the "right way" is to attempt to provide an answer.
Pointing them to Section 2.2 of the Manual (Your First Program), is just plain Rude!<hr>
Now, for that "Answering the question" part...
Oh, and let me add here that it's preferable to have actually tested the answers you give.
Pull out the 4550, plug it in a breadboard and make sure you're giving an answer, not more problems for the person to deal with.
In my case it's easy... Just pull out the mister_e 18F4550 USB Demo prototype (minus a few LED's) from
http://www.picbasic.co.uk/forum/showthread.php?p=31405
(Yup, I keep them.)
Which then allows me to present the following post, with great confidence that it'll work. Because I've actually done it.
<br>
DT
Bookmarks