0x3D14 IS only 14 bits!! 11 - 1101 - 0001 - 0100. the ' D' really should be 1 as bits 12,11 and 10 are unused..
hi Ian,
Sent you a PM about 1hr ago, ref this ADC setup problem on OSH.
E.
Eric " Good enough is Perfect "
I will NOT answer PM's requesting technical help, please use the Forum
"Nigels Asm tutorials:" www.winpicprog.co.uk/
"Ian Rogers 'C' conversion of Nigels Asm tutorials:" http://www.electro-tech-online.com/c...torials-c.html
0x3D14 IS only 14 bits!! 11 - 1101 - 0001 - 0100. the ' D' really should be 1 as bits 12,11 and 10 are unused..
I'd give my left arm to be ambidextrous
Nigel's tutorials in asm... http://www.winpicprog.co.uk/
Nigel's tutorials.. re-written in C. http://www.electro-tech-online.com/c...torials-c.html
I want to clear this why there is double __ underscore???
__config 0x3D14
Last edited by RITESH KAKKAR; 10th March 2012 at 12:19 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
andwhat 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
New code for you ritesh..... Put this into oshonsoft assembler it works ok now
Code :;include "P16F676.inc" ;include the defaults for the chip __config 0x3114 ;sets the configuration settings (oscillator type etc.) ; HERE SET TO INTERNAL OSCILLATOR 4MHZ ORG 0 GOTO INIT INIT CLRF OPTION_REG BSF STATUS,RP0 CLRF VRCON MOVLW 0x3f MOVWF TRISA ; porta as input MOVLW 0x0 CLRF ANSEL ; disable ADC MOVWF TRISC ; portb as output BCF STATUS,RP0 MOVLW 0x7 MOVWF CMCON START btfss PORTA,1 ; test bit 1 call delay GOTO START delay movlw 0xff movwf PORTC movlw 0fh movwf 0x21 dECfsz 0x21,f clrf PORTC RETURN end
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.
I'd give my left arm to be ambidextrous
Nigel's tutorials in asm... http://www.winpicprog.co.uk/
Nigel's tutorials.. re-written in C. http://www.electro-tech-online.com/c...torials-c.html
Thanks the code are working ...
What the need of this can't we start normally?ORG 0
GOTO INIT
please explain more this part of code...
CLRF OPTION_REG??
CLRF VRCON??
I was just trying to find out why the ADC wasn't being turned off.
VRCON is for the voltage reference module (it's unused, so I disabled it)
OPTION_REG has interrupt settings so I disabled them all.
ORG 0
GOTO INIT
Try to get into the habit of including this. When you use tables and interrupts you'll need to jump over them.
I'd give my left arm to be ambidextrous
Nigel's tutorials in asm... http://www.winpicprog.co.uk/
Nigel's tutorials.. re-written in C. http://www.electro-tech-online.com/c...torials-c.html
Sticky.
PIC16F676 Datasheet Typo.
Eric " Good enough is Perfect "
I will NOT answer PM's requesting technical help, please use the Forum
"Nigels Asm tutorials:" www.winpicprog.co.uk/
"Ian Rogers 'C' conversion of Nigels Asm tutorials:" http://www.electro-tech-online.com/c...torials-c.html
Please clear one more doubt __config why two underscore not single is that also set in data sheet??
__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.
I'd give my left arm to be ambidextrous
Nigel's tutorials in asm... http://www.winpicprog.co.uk/
Nigel's tutorials.. re-written in C. http://www.electro-tech-online.com/c...torials-c.html
| Tags |
| Similar Threads | ||||
| Thread | Starter | Forum | Replies | Last Post |
| How to start with analog soundboard? | Ibanezarus | General Electronics Chat | 3 | 11th July 2006, 08:14 AM |
| how to start to develop SIM card reader | janetsmith2000@yahoo.com | Microcontrollers | 4 | 21st June 2005, 09:59 AM |
| how to start | gastonanthony | Microcontrollers | 1 | 9th April 2005, 09:40 AM |
| Assembly language - how to start ?? - help~ | soohino | Microcontrollers | 1 | 4th January 2005, 03:42 PM |
| pic 16f876 programmer how to start | stanley | Electronic Projects Design/Ideas/Reviews | 1 | 5th January 2004, 10:21 AM |