View previous topic :: View next topic |
Author |
Message |
cerr
Joined: 10 Feb 2011 Posts: 241 Location: Vancouver, BC
|
Turn off SCSO |
Posted: Wed Jun 08, 2011 11:33 am |
|
|
Hi There,
I'm trying to use PIN_C0 as an output but seem not to be able to do so. Looking at the datasheet, I see that it can be a SSCO or a SCKLI as well. I don't need nor want this functionality. How do I switch this off best to be able to use it as a normal ouput?
Thank you,
My little test program:
Code: | #include <18F86K22.h>
#case
#device adc=16 HIGH_INTS=TRUE
#fuses NOWDT //Watch Dog Timer uses 1:65536 Postscale
#fuses HSH //Hi-Speed crystal oscillator
#fuses NOBROWNOUT //No brownout reset
#fuses NOPLLEN //No PLL enabled
#fuses BBSIZ1K //1K words Boot Block size
#fuses NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#fuses PROTECT
#use delay(clock=20000000)
void main (void)
{
output_high(PIN_C0);
output_high(PIN_A4);
while(1);
} |
|
|
|
Fusillade
Joined: 02 Aug 2007 Posts: 31
|
|
Posted: Thu Jun 09, 2011 3:14 pm |
|
|
Have you tried the following?
#fuses SOSC_DIG _________________ New:
Compiler Version: 5.078
IDE Version: MPLAB X V4.15
Devices: PIC18LF****
Old:
Compiler Version: 4.121
IDE Version: MPLAB IDE V8.63
Devices: PIC18LF**** |
|
|
cerr
Joined: 10 Feb 2011 Posts: 241 Location: Vancouver, BC
|
|
Posted: Thu Jun 09, 2011 3:15 pm |
|
|
Oh Hi Fusillade,
Sorry my second post just coincided with your post.
I haven't tried #fuses SOSC_DIG yet, will do that right now!
Thanks for your reply!
Ron
I thought I might have a bad chip, got a second one but same result. My code, again:
Code: | #include <18F86K22.h>
#case
#device adc=16 HIGH_INTS=TRUE
#fuses NOWDT //Watch Dog Timer uses 1:65536 Postscale
#fuses HSH //Hi-Speed crystal oscillator
#fuses NOBROWNOUT //No brownout reset
#fuses NOPLLEN //No PLL enabled
#fuses BBSIZ1K //1K words Boot Block size
#fuses NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#fuses NOPROTECT
#use delay(clock=20000000)
void main (void)
{
while(1) {
output_high(PIN_C0);
output_high(PIN_A4);
delay_ms(10);
output_low(PIN_C0);
output_low(PIN_A4);
delay_ms(10);
}
} |
Result: RA4 toggles just fine but RC0 stays low all the time... how can I get that to toggle as well?
Thanks!
Ron
Help would be greatly appreciated |
|
|
cerr
Joined: 10 Feb 2011 Posts: 241 Location: Vancouver, BC
|
|
Posted: Thu Jun 09, 2011 3:21 pm |
|
|
Yes, great!
Thank you very much!!!
#fuses SOSC_DIG did it! Nice, awesome! |
|
|
Fusillade
Joined: 02 Aug 2007 Posts: 31
|
|
Posted: Thu Jun 09, 2011 3:23 pm |
|
|
cerr wrote: | Yes, great!
Thank you very much!!!
#fuses SOSC_DIG did it! Nice, awesome! |
At least I did one thing right today. _________________ New:
Compiler Version: 5.078
IDE Version: MPLAB X V4.15
Devices: PIC18LF****
Old:
Compiler Version: 4.121
IDE Version: MPLAB IDE V8.63
Devices: PIC18LF**** |
|
|
|