Shop OBEX P1 Docs P2 Docs Learn Events
Help asm — Parallax Forums

Help asm

ratronicratronic Posts: 1,451
edited 2007-03-21 02:21 in Propeller 1
I am trying to figure out how to wait or set sysclk to 0 and also to get cnt back in spin after. I really haven't any asm code to show you , but maybe you can show me an example how to read the clk into a variable so·that I can print it in spin or from asm. And how to cnt input pin 7 in asm. ·I have been trying but am unclear of syntax w/waitpne or ina in asm. Any help would be appreciated!! Thanks Dave.

P.S. I promise to learn if somebody can get started! (I am trying to time a negative pulse as fast as I can.)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fix it if ain't broke·
D Rat

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-21 01:03
    Please organize your questions better. They're all jumbled together and it makes it hard to figure out what you're trying to do.

    The system clock is an internal counter that cannot be reset. It can be read at any time by using the value "CNT" in Spin or the memory location "CNT" in assembly. Look in the Propeller Manual under CNT. For information about counting or timing a input on pin 7, read the application note (AN001) on the built-in counters here: www.parallax.com/propeller/downloads.asp.
  • ratronicratronic Posts: 1,451
    edited 2007-03-21 01:36
    I want to time a negative pulse on P7 with the most fastest count I can retrive. Attached is what I am playing with. Thanks Dave.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fix it if ain't broke·
    D Rat
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-21 01:53
    It looks you need to use the built-in counters to time your negative pulse. Do look at AN001, particularly mode %01100. The counter should increment with every clock cycle that occurs while the pin involved is negative. Your program would read the counter sometime when the input is high and reset the counter to zero. The counter can time the input to within a clock cycle (12.5ns)
  • ratronicratronic Posts: 1,451
    edited 2007-03-21 02:21
    Thanks Mike for pointing me the right way as always!!! It will take awhile but I will get it. Dave.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fix it if ain't broke·
    D Rat
Sign In or Register to comment.