View previous topic :: View next topic |
Author |
Message |
adcor
Joined: 21 Feb 2008 Posts: 31
|
Issues with setting IO on SOSC |
Posted: Sat Dec 12, 2020 3:30 am |
|
|
I can not set the IO SOSC pins RB4/RA4 on 24FJ64GA004, compiler 5.093.
I have tried different fuses configurations but no luck. In the lst file there is always SOSC_SEC fuse set. I have a LED on RA8 just to prove the chip is working, which it does. Can anyone spot anything wrong? Thanks.
Code: |
#include <24fj64ga004.h>
#device ICSP=1
#use delay(int=8MHz, clock=32MHz)
#FUSES NOWDT //No Watch Dog Timer
#FUSES NOJTAG //JTAG disabled
#FUSES OSCIO //OSC2 is general purpose output
void main(void)
{
while(1)
{
output_high(PIN_A8);
output_high(PIN_B4);
output_high(PIN_A4);
delay_ms(50);
output_low(PIN_A8);
output_low(PIN_B4);
output_low(PIN_A4);
delay_ms(50);
}
} |
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19513
|
|
Posted: Sat Dec 12, 2020 9:08 am |
|
|
SOSC_SEC does not select the secondary oscillator. It sets the power level
for the driver on these pins. The only choices are SOSC_SEC and
SOSC_SEC_LP.
The oscillator is controlled by the OSCEN bit internally. With the internal
oscillator selected and everything else that uses this disabled, it should default
to off. Have checked and it does.
However you are trying to do something impossible. The SOSCI pin is
only available as an _input_ pin. It has no output driver. THE SOSCO pin
should work. If you check the data sheet, in Table 1-2, you will find the
SOSCI pin listed as 'I' for input, not I/O. The same is true of the OSCI pin. |
|
|
adcor
Joined: 21 Feb 2008 Posts: 31
|
|
Posted: Sat Dec 12, 2020 1:57 pm |
|
|
Thank you, I was hoping to use the entire 16-bit PortB structure ...looks like I have to chnge the processor. |
|
|
|