+ Reply to Thread
Results 1 to 4 of 4
-
- 11th February 2019, 00:51 #1
PORTA.5 not responding on 16F18346??
Bizarre behavior that I cannot explain on the PIC16F18346... any suggestions would be more than welcome.
Simply put, MYLED does NOT flash, but the output from the pin remains LOW.
meanwhile, MYLED1 flashes like it's supposed to.
STUMPED...
Code:' PORT/ADCON SETTINGS ADCON0=%00010001 'A/D control ADCON1=%11110000 '(RC conversion clock, right justified 10-bit result) '--------------------------------------------------------------- PORTA=%00000000 'assign initial output values so they don't show up randomized TRISA=%011101 'assign DDRA (1=in, 0=out) ANSELA=%010000 'PA.4 analog mode 'WPUA.3=1 'enable WPU on pushbutton input (later use) 'WPUA.2=1 'enable WPU (later use) '--------------------------------------------------------------- PORTB=%00000000 'assign initial output values so they don't show up randomized TRISB=%11100000 'assign DDRB (1=in, 0=out) ANSELB=%00000000 'all in digital mode 'WPUB=%11000000 'WPU for future '--------------------------------------------------------------- PORTC=%00000000 TRISC=%00000000 ANSELC=%00000000 '******************************************************************************* ' ' DEFINES define OSC 32 DEFINE ADC_CLOCK 2 'use separate RC conversion clock DEFINE ADC_BITS 10 ' Set number of bits in result DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS define WRITE_INT 1 'the following must be used for this chip to disable default settings (for PWM enabled) DEFINE CCP1_REG 0 'channel-1 unused DEFINE CCP1_BIT 0 'channel-1 unused DEFINE CCP2_REG PORTC 'channel 2 port DEFINE CCP2_BIT 3 'channel 2 bit (C3) used later DEFINE CPP3_REG 0 'channel 3 unused DEFINE CPP3_BIT 0 'channel 3 unused DEFINE CCP4_REG 0 'channel 4 unused DEFINE CCP4_BIT 0 'channel 4 unused '******************************************************************************* ' ' VARIABLES / ALIASES MYLED var PORTA.5 'pin 2 MYLED1 VAR PORTA.1 'pin 18 '******************************************************************************* ' ' MAIN PROGRAM main: pause 1000 MYLED=~MYLED MYLED1=~MYLED1 goto main end
-
- 11th February 2019, 05:59 #2
Re: PORTA.5 not responding on 16F18346??
PORTA.5 is "CLKIN OSC1"pin, depending on config and osc settings on OSCCON1, OSCCON2, and OSCCON3.
There seems to be no OSCCONx in your code.
You need to make sure that the osc stays internal."If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
-
- 11th February 2019, 16:44 #3
Re: PORTA.5 not responding on 16F18346??
Thanks - after reviewing, I think I may have left part of the configuration word at its default value instead of turning EXTERNAL OSC *OFF*.
Will test and report back.
-
- 12th February 2019, 13:47 #4
Re: PORTA.5 not responding on 16F18346??
YUP it wasn't OSCCONx per se, but you got me thinking and it WAS the Configuration Word Settings. I had (erroneously) assumed that by setting INTOSC at 32MHz, no other config word settings would be needed regarding osc, but NOPE, there's another setting you need to set to "OFF" to kill the secondary oscillator association with pins.
Thanks sayzer!
Similar Threads
-
Second I2C address not responding
By Amoque in forum mel PIC BASIC ProReplies: 21Last Post: - 18th October 2013, 06:27 -
18f4550 ADC not responding
By celequanta in forum mel PIC BASIC ProReplies: 3Last Post: - 10th March 2012, 13:26 -
PORTC.4 and C.5 not responding to inputs.
By jmgelba in forum mel PIC BASIC ProReplies: 2Last Post: - 23rd February 2012, 22:41 -
PIC stop responding - Strange Problem!
By financecatalyst in forum mel PIC BASIC ProReplies: 8Last Post: - 31st August 2009, 14:06 -
Pic 18f252 not responding
By gringo332 in forum GeneralReplies: 5Last Post: - 22nd March 2007, 22:21
Bookmarks