Altering a variable in a loop.


Results 1 to 27 of 27

Threaded View

  1. #11
    Join Date
    Aug 2012
    Location
    Comodoro Rivadavia - Patagonia Argentina
    Posts
    51


    Did you find this post helpful? Yes | No

    Default Re: Altering a variable in a loop.

    Just like that mackrackit!!
    I, for example, in a project to implement a 10-bit ADC and the output of the pic, I had to generate a 10-bit DAC to simulate approximately the incoming analog signal, so I wrote this (similar to the example):

    Adc VAR WORD
    D0 VAR Adc.0
    D1 VAR Adc.1
    D2 VAR Adc.2
    D3 VAR Adc.3
    D4 VAR Adc.4
    D5 VAR Adc.5
    D6 VAR Adc.6
    D7 VAR Adc.7
    D8 VAR Adc.8
    D9 VAR Adc.9

    TRISA = %11111111
    TRISB = %00000000
    TRISD = %00000000

    ADCON1.7 = 1

    Inicio:
    ADCIN 0,Adc

    PORTD.0 = D0
    PORTD.1 = D1
    PORTD.2 = D2
    PORTD.3 = D3
    PORTD.4 = D4
    PORTD.5 = D5
    PORTD.6 = D6
    PORTD.7 = D7
    PORTB.0 = D8
    PORTB.1 = D9
    GoTo Inicio

    regards friends!!!
    Last edited by martintorres; - 15th September 2012 at 08:04.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts