Shop OBEX P1 Docs P2 Docs Learn Events
DAC output/ Pin number selection? (Propeller) — Parallax Forums

DAC output/ Pin number selection? (Propeller)

PatricePatrice Posts: 5
edited 2008-05-05 20:50 in Propeller 1
Hi everyone,
·
- Using (well trying to use), cog counters to get analogue outputs, I cannot find·how to drive the APIN signal to any other pin than P0; lets say to P5 instead of P0.
For instance, in operation mode %00110 DUTY single ended ·(Code like the one in Parallax Application Note AN001/Propeller counters – Duty Cycle modes of operation p11-13)
·
Please, does anyone know how to do that, and even if it is possible?

- In fact six bits APIN and BPIN of CTRx register fields are quite·a mystery to me.
What difference between affecting APIN reg. = %X10000 or %X00001?
I first though it could mean Pin16 or Pin1, but it does not seem so.
Maybe I missed something in the manual or did not the right thing with DIRA.
·
Thank you for helping.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-01 16:45
    APIN and BPIN specify the output pin to be used for the counter. The various counter modes use one or two I/O pins. APIN is the primary pin to be used. BPIN is the (optional) secondary pin to be used. The number in the 6 bit field is the pin number. Pins from 32 to 63 do not exist in the current Propeller chip. An APIN value of %010000 specifies I/O pin 16 while a value of %000001 specifies I/O pin 1. You also have to set the corresponding DIRA bit to a one. If you don't set the DIRA bit, the counter output is "or"d with the OUTA register value and made available to the output circuitry, but the output driver transistors are disabled (they're enabled by the DIRA bit).
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-05-01 16:49
    Hi, Patrice I see you've read AN001. Can you provide the code you are using to set CTRA? You have to make sure if you are setting fields in different instructions that you preserve the current contents. Figuring out whats going on in your code will be easier if you can post the snippet which sets up the counter.

    The reason there are 6 bits is that there are plans for 64 I/O devices, so that 6th bit is <reserved>. AN001 makes a brief mention about this on page 2.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • PatricePatrice Posts: 5
    edited 2008-05-05 08:06
    Paul, Mike,

    I could not make another try again before this morning,·now I think I should apologize for disturbing because it is Ok.
    Cumulated mistakes and number of "0" that was probably wrong in fact...
    Thank you very much
    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-05-05 20:50
    No problem, glad you got it working.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
Sign In or Register to comment.