a question about ports in Dspic(F33..256GP710)

Discussion in 'Embedded Systems and Microcontrollers' started by saman1969, Nov 11, 2012.

  1. saman1969

    Thread Starter New Member

    Nov 2, 2012
    15
    0
    I want to set '1' pin number 18 (that belongs to port A) of my Dspic . because multitasking of some pins in dspic , i should disable some features of these pin so it will act as I/O pins . but unfortunatly i can not this.
    i tested that by instruction "LATA.F12=1" this register change , but pin 18 that related to it does not change to '1'
    my code is:

    main() {
    TRISA.F12=O; //related to pin 18 that belongs to port A
    AD1PCFGH=0XFFFF; //for disable of analoug input of some pins
    AD1PCFGL=0XFFFF;
    AD2PCFGL=0XFFFF;

    LATA.F12=1; //set '1' to pin 18
    while(1)
    {
    ...
    }
    }

    is any other register that i should set?
    thanks
     
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    your compiler doesn't complain that you are setting
    as opposed to the number zero?
     
    saman1969 likes this.
  3. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    Look up the datasheet carefully for that I/O port.

    You may also need to configure the I/O routing matrix for some PICs, while I don't know about this particular model.
     
    saman1969 likes this.
Loading...