Nigel Goodwin said:
lompa said:
Nigel Goodwin said:
lompa said:
thanks for the help, im actually using basic to program the chip, do i still have to follow the same steps? but just do it with basic coding?
If you're using a BASIC compiler all you should need to do is tell your compiler what chip you are using, the compiler should produce the correct code automatically. Presuming your compiler supports the chip of course?.
it wont know i am using a 4mhz external osc though, what happens if the internal ones runs and the external one?
thanks for the help
They can't both run, the design on the PIC means only one oscillator option can be selected.
Anything like this is down to your particular BASIC compiler, how do you currently tell it to use a 4MHz oscillator?. The 16F84 has a number of different oscillator options, if the right one isn't selected it won't work - the 628 is no different, it needs telling which option to use.
As you're using BASIC, this is ENTIRELY down to the compiler, the instructions should tell you how to do it.
At the begining of your code , you should set the config fuses.
One of these being " xt_osc or hs_osc" to set external xtal.
the following is copied from the proton manual
configuration fuse settings vary from PICmicro to PICmicro, however, certain settings are standard to most PICmicro types. These are: -
WDT_ON Enable the internal Watchdog timer.
WDT_OFF Disable the internal Watchdog timer.
HS_OSC Use a High-speed crystal (Xtals over 4MHz) .
XT_OSC Use a standard crystal (4MHz or under).
LP_OSC Use a low frequency crystal (KHz range).
PWRTE_ON Enable power up timer.
PWRTE_OFF Disable power up timer.
Example
' Disable the Watchdog timer and specify an HS_OSC etc, on a PIC16F877 device
CONFIG HS_OSC , WDT_OFF , PWRTE_ON , BODEN_OFF , LVP_OFF , WRTE_ON , CP_OFF , DEBUG_OFF