Shop OBEX P1 Docs P2 Docs Learn Events
Does the internal video counter (%00001) have to be used for video only? — Parallax Forums

Does the internal video counter (%00001) have to be used for video only?

OK, so from what I understand, the CTRMODE (%00001) is used for video generation. But it produces no output itself on APIN or BPIN.

However, what if I wanted to use BPIN as a different frequency on the same COG?

For example, BPIN maybe could produce a 3.5MHz square wave while CTRA is doing NTSC*16. Hope that makes sense.

Is this possible? Or, are you restricted from any other counters on the same COG if you enable video mode? I was thinking that even if I managed to have two timers on the same COG, it wouldn't utilize the pixel shifting, etc. unless I was using the video mode.

Thanks.

Comments

  • kwinnkwinn Posts: 8,697
    Yes, it's possible. Download application note AN001 for a more detailed explanation of the counters.
  • BeanBean Posts: 8,129
    Any I/O pin can the APIN or the BPIN for any of the counters.
    Using one counter in video mode does not prevent using any of the other counters from using any pin they want for APIN or BPIN.
    The video mode counter external output IS the video output.

    I'm not sure if I answered what you wanted to know...

    Bean
  • kwinnkwinn Posts: 8,697
    After reading Bean's reply and re-reading your post it seems I may have misunderstood your question. Hope the following clears things up.

    The Propeller 1 only has one 32 bit output port (outa), so there is no B port and no BPIN.

    Both counter A and counter B can be set up to output signals to any specific APIN in modes 2 to 7.

    Counter A or counter B can be set up to generate a clock signal for video or other uses. Only one counter is needed to clock the video circuit. The other counter can be used for something else.

    When a counter is in video mode the output signal goes directly to the video circuitry and cannot go to a pin as well. The APIN field is ignored.
  • Actually, both answers are helpful.

    That's what I was looking for.

    Thanks!
  • kwinn wrote:
    The Propeller 1 only has one 32 bit output port (outa), so there is no B port and no BPIN.
    There is no B port, but some counter modes (e.g. differential output, logic input) support both an APIN and a BPIN.
    kwinn wrote:
    When a counter is in video mode the output signal goes directly to the video circuitry and cannot go to a pin as well. The APIN field is ignored.

    Actually, you can use any PLL mode with the video circuitry, including those that output to a pin. The so-called "video" counter mode is only there to prevent wasting a pin if you don't need it.

    -Phil
  • AribaAriba Posts: 2,690
    Because I have understood the initial quetion a bit different, here is my respond:

    Both counters, CTRA and CTRB have there own APIN and BPIN. These are just two pins you can select and the names are not associated with CTRA or CTRB.

    So if you setup CTRA for video, you can still use CTRB to output a frequency, just use PINA of CTRB to select the pin. PINB is only used if you need two pins for a counter, either two outputs, or an input and an output pin.

    Andy
  • Thanks for clearing it up.

Sign In or Register to comment.