10th March 2012 12:16 PM
Sent you a PM about 1hr ago, ref this ADC setup problem on OSH.
10th March 2012 12:16 PM
0x3D14 IS only 14 bits!! 11 - 1101 - 0001 - 0100. the ' D' really should be 1 as bits 12,11 and 10 are unused..
10th March 2012 12:17 PM
I want to clear this why there is double __ underscore???
Last edited by RITESH KAKKAR; 10th March 2012 at 12:19 PM.
10th March 2012 12:23 PM
so, we are using this Oscillator:-
100 = INTOSC oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN
what does this mean?
MCLRE: RA3/MCLR pin function select(5)
1 = RA3/MCLR pin function is MCLR
bit 13-12 BG1:BG0: Bandgap Calibration bits for BOD and POR voltage(1)
00 = Lowest bandgap voltage
11 = Highest bandgap voltage
10th March 2012 12:34 PM
New code for you ritesh..... Put this into oshonsoft assembler it works ok now
;include "P16F676.inc" ;include the defaults for the chip
__config 0x3114 ;sets the configuration settings (oscillator type etc.)
; HERE SET TO INTERNAL OSCILLATOR 4MHZ
MOVWF TRISA ; porta as input
CLRF ANSEL ; disable ADC
MOVWF TRISC ; portb as output
btfss PORTA,1 ; test bit 1
Band gao voltage associated with BOD & POR Brown Out Detect and Power On Reset Read section 9.3.5 on this topic.
Last edited by Ian Rogers; 10th March 2012 at 12:35 PM.
10th March 2012 12:57 PM
Thanks the code are working ...
What the need of this can't we start normally?
please explain more this part of code...
10th March 2012 01:17 PM
I was just trying to find out why the ADC wasn't being turned off.
Originally Posted by RITESH KAKKAR
VRCON is for the voltage reference module (it's unused, so I disabled it)
OPTION_REG has interrupt settings so I disabled them all.
Try to get into the habit of including this. When you use tables and interrupts you'll need to jump over them.
10th March 2012 01:34 PM
10th March 2012 01:59 PM
Please clear one more doubt __config why two underscore not single is that also set in data sheet??
10th March 2012 02:54 PM
__config is a makro.. written by someone in microchip... To know why there is two underscores you'll need to find him and ask him.
Usually the underscore is used in C for assembler routines... purely for keeping identifiers apart.... If it was declared just config... It would mean no-one could use this identifier.
The datasheet may well have two, its depends on the font used.
Sorry... Its a directive for the assembler / linker, not a makro.....
Last edited by Ian Rogers; 10th March 2012 at 03:07 PM.
Electronic Circuits |
Page Time: 0.14571 seconds Memory: 7,721 KB Queries: 17 Templates: 0