Searching \ for '[PIC]: GO/DONE' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'GO/DONE'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: GO/DONE'
2002\10\24@131044 by MILAN BASA

flavicon
face
In this example code i need to set GO/DONE, but it is still ZERO.
Any ideas?
(MPLAB v5.70)

  Thank You, Mino.

;**********************************************************************
;           DO
; Procesor: 12F675    XT-oscil: 2MHz
;**********************************************************************
          LIST  P=12F675
       #INCLUDE "P12F675.INC"
       __CONFIG _CPD_OFF & _CP_OFF & _BODEN_OFF & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF & _XT_OSC
;......................................................
TMP             EQU     20h
;.......................................................
               ORG     000h
               GOTO    START
;.......................................................

START
       bsf     STATUS,RP0
       movlw   B'00000001'             ;GPIO<0> IN, other OUT
       movwf   TRISIO
       movlw   B'00010001'             ;Fosc/8, AN<0> analog input
       movwf   ANSEL
       bcf STATUS,RP0
       movlw   B'00000000'
       movwf   CMCON                   ;Comparator = default
       movlw   B'10000000'
       movwf   ADCON0          ;Right justif.,Channel AN<0> analog
;.....................................................
adfoto
       bsf             ADCON0, ADON    ;A/D on
       movlw   0x08
       movwf   TMP
acqt
       decfsz  TMP,1           ;wait acquisition time
       goto            acqt
;.....................................................
       bsf             ADCON0, GO      ; Start A/D Conversion
       nop                                     ; ADCON0,GO = 0 !!!!!!!!!!!!!!!
convt
       btfsc   ADCON0, GO      ;wait conversion time
       goto            convt
       bcf             ADCON0, ADON    ;A/D off
       nop
       nop
       nop
       goto    START
;........................................................

       end

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\10\24@135127 by Dwayne Reid

flavicon
face
At 07:07 PM 10/24/02 +0100, MILAN BASA wrote:
>In this example code i need to set GO/DONE, but it is still ZERO.
>Any ideas?
>(MPLAB v5.70)
>         bsf             ADCON0, GO      ; Start A/D Conversion

Bit name for GO/DONE is GO_DONE

You are using GO

Try changing it and seeing if that makes a difference.

dwayne

--
Dwayne Reid   <spam_OUTdwaynerTakeThisOuTspamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 18 years of Engineering Innovation (1984 - 2002)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\10\24@144225 by MILAN BASA

flavicon
face
> At 07:07 PM 10/24/02 +0100, MILAN BASA wrote:
> >In this example code i need to set GO/DONE, but it is still ZERO.
> >Any ideas?
> >(MPLAB v5.70)
> >         bsf             ADCON0, GO      ; Start A/D Conversion
>
> Bit name for GO/DONE is GO_DONE
>
> You are using GO
>
> Try changing it and seeing if that makes a difference.
>
> dwayne

No difference.
                      Mino.
.....basamKILLspamspam@spam@emo.seas.sk

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\10\24@195215 by Bob Bullock

flavicon
face
Mino,

I assembled your file and checked the listing.
As far as I can tell, there is nothing wrong with your code regarding
setting the GO bit.
I added the following lines and checked the operation with the simulator.

        clrf             ADCON0
        bsf             ADCON0,0
        bsf             ADCON0,1
        bsf             ADCON0,2
        bsf             ADCON0,3
        bsf             ADCON0,4
        bsf             ADCON0,5
        bsf             ADCON0,6
        bsf             ADCON0,7
        bsf             ADCON0, GO      ; Start A/D Conversion
        nop                                     ; ADCON0,GO = 0
!!!!!!!!!!!!!!!

after running through this, all bits were set except for bit1, bit4 and bit5
bits 4 and 5 are unimplemented on the 12F675 and defined to read as zero.

I belive what you are dealing with is a simulator bug.  I suggest you
ignore this and continue, it will very likely work just fine in silicon.

By the way, it is often helpful to post the list file from the section of
interest.  Related to this, you should try and become familiar with looking
at the list file, you can spot a lot of problems this way.  Your ultimate
check is to look up the instruction format for the line in question and
decode the opcode field.

regards,

Bob Bullock
Certified Microchip Consultant

At 08:39 PM 10/24/2002 +0100, you wrote:
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...