Shop OBEX P1 Docs P2 Docs Learn Events
Pathetic Propeller Program Please! — Parallax Forums

Pathetic Propeller Program Please!

VaatiVaati Posts: 712
edited 2009-05-07 22:07 in Propeller 1
I need a small pathetic program to ensure that my propeller works.· I looked in the obex but all of those are too complex for a simple test.· I have no clue how to use the prop either; I keep on typing in commands like "HIGH 2, DEBUG CLS" because I've used the BS2 for so long!· lol.gif··Also, could someone explain the differences/similarities of ASM, Spin, and whatever else the prop can be programmed with.

Thanks.· yeah.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!

Comments

  • rokickirokicki Posts: 1,000
    edited 2009-05-07 18:51
    What is your platform? Demo board, PDB, or hand-wired on a breadboard? Can you attach an LED and resistor to one of the pins?
  • ProcessingData...ProcessingData... Posts: 208
    edited 2009-05-07 18:53
    Try this:
    Var
    long Index
    Pub Blink
    Dira[noparse][[/noparse]0..32]~~
    Repeat 2
    Repeat Index from 0 to 32
    !Outa[noparse][[/noparse]Index]
    waitcnt(clkfreq/2 + cnt)

    This program will turn all of the pins on one by one waiting a half second in between, then turn them off the same way.(on a working propeller [noparse];)[/noparse]

    I also have a prop chip that will run this, but will not run any video programs, so try running one of those too. [noparse]:)[/noparse]

    .:ProccessingData...:.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Basic Stamp,···· Propeller,·· · SX,·· FUN!


    START:·
    >Proccessing Data. . . .··
    >Task Complete. . .·.
    >Saving Data. . . .
    >Entering SLEEP Mode. . . .
    >Signing OFF


    ·
  • VaatiVaati Posts: 712
    edited 2009-05-07 19:06
    Okay, well I have it on the boss board.... Check out the "troubleshooting the propeller chip" forum for a pic of it on the boss board. One thing is that I did get a prop chip that works instead of that broken one discussed.

    @ProcessingData... So do you have a simple prop hookup for a video program...? I just want simple programs so I can actually learn SPIN instead of copying and pasting bits of other people's code without understanding any of it... smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
  • VaatiVaati Posts: 712
    edited 2009-05-07 19:12
    One more thing--- Do I select load RAM or load EEPROM to run that sample test? [noparse][[/noparse]I must be sounding stupid asking all these pathetic prop quesitons....]

    thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
  • ProcessingData...ProcessingData... Posts: 208
    edited 2009-05-07 19:15
    You can load a demo VGA program onto it, and then verify that pin 16 turns on at least. I understand about not wanting to cut and pastewink.gif, that's what·I did until the day when·I FINALLY figured it out, and could use it instead of the STAMP.·hop.gif


    [noparse][[/noparse]edit: Load to ram or eeprom. ram is erased after the program runs, so it will only run once. If you load to EEPROM, the chip will run it again if you push the reset button. The basic stamp always loads to eeprom, the propeller gives you the option.smile.gif ]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Basic Stamp,···· Propeller,·· · SX,·· FUN!


    START:·
    >Proccessing Data. . . .··
    >Task Complete. . .·.
    >Saving Data. . . .
    >Entering SLEEP Mode. . . .
    >Signing OFF


    ·
  • Nick McClickNick McClick Posts: 1,003
    edited 2009-05-07 19:30
    First step - download the propeller manual! start with SPIN, see how things work and go from there. For the stuff I do, I usually do control structures in SPIN and time sensitive stuff in PASM. SPIN's also a lot easier to debug (for me), and develop in, so I prefer spin unless I need the speed.

    Generally, when you develop, you load your program to RAM, test, and revise. When you're done, load to eeprom. If you've setup the video DAC on the boss board, just load the TV graphics demo (it's one of the demo files in the prop tool).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Gadget Gangster - Share your Electronic Projects - Sign up as a Designer and get a free 4-pack of Project Boards!
  • VaatiVaati Posts: 712
    edited 2009-05-07 19:32
    Awesome! I think I'll use ram for now as I'm learning the ins and outs of the propeller (no pun intended smile.gif ) but the other reason is that I don't have a reset button... I had better add one... but where and how would I do so?

    Thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
  • JasonDorieJasonDorie Posts: 1,930
    edited 2009-05-07 19:36
    Vaati,

    The program posted by ProcessingData wont work as is, since the formatting was lost in posting.· The Propeller Tool uses indenting to denote program blocks for things like repeat loops.· The code should look more like this:

    Var
      long Index
    
    Pub Blink
      Dira[noparse][[/noparse]0..32]~~
      Repeat 2
        Repeat Index from 0 to 32
          !Outa[noparse][[/noparse]Index]
          waitcnt(clkfreq/2 + cnt)
    

    I don't have a prop in front of me, but that looks like it should work.· [noparse]:)[/noparse]

    You can run it either from RAM or from EEPROM.· Compiling to EEPROM means it'll still be there after you power the Prop off and back on again.· Compiling to RAM means it'll only be there until you lose power.

    Jason
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-07 19:36
    When in doubt, read the manual. Also look at what others have successfully done before. In particular, there are schematics available from the Propeller downloads page for the Demo Board and the Protoboard. The Demo Board demonstrates all sorts of circuits ... for VGA, TV, keyboard, mouse, DAC for audio, ADC for a microphone, reset buttons, EEPROMs, power supplies. That's why it's a demo board.
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2009-05-07 19:39
    Vaati,
    Attached are some images - showing the required connections for VGA and TV .... as per demo board ..··but like the others have said - start with the simple examples and work up from there ..

    Regards,
    John Twomey

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'

    Those who can, do.Those who can’t, teach.
    444 x 354 - 20K
    444 x 354 - 11K
  • Nick McClickNick McClick Posts: 1,003
    edited 2009-05-07 19:41
    For reset, just bring RESn (M13) to ground. I don't usually use a reset button - when you do a load to ram, it resets the prop anyway.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Gadget Gangster - Share your Electronic Projects - Sign up as a Designer and get a free 4-pack of Project Boards!
  • VaatiVaati Posts: 712
    edited 2009-05-07 19:43
    Okay, it compiled and everything.... After selecting "Run-Compile Current > Load RAM" I hooked up an LED to one of the I/O pins and nothing seemed to happen... Why can't there just be a button that says RUN like the Basic Stamp editor?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!

    Post Edited (Vaati) : 5/7/2009 7:49:28 PM GMT
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2009-05-07 19:45
    Vaati,
    Can you add your program as an attachment to the forum thread..

    Regards,
    John

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'

    Those who can, do.Those who can’t, teach.
  • VaatiVaati Posts: 712
    edited 2009-05-07 19:51
    Here's the program I'm testing.

    Thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2009-05-07 19:58
    Vaati,

    That's fine.. However you may want to repeat aq test for longer to ensure all is well ..



    try this ..

    Pub Blink
      Dira[noparse][[/noparse]0]~~
      Repeat 
          !Outa[noparse][[/noparse]0]
          waitcnt(clkfreq/2 + cnt)
    



    Connect to 'P0' ensure correct LED orientation and appropriate resistor in series ..

    EDIT: Vaati - please NoteThis will only toggle 'P0' !

    Regards,

    John

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'

    Those who can, do.Those who can’t, teach.

    Post Edited (QuattroRS4) : 5/7/2009 10:47:32 PM GMT
  • VaatiVaati Posts: 712
    edited 2009-05-07 20:12
    Woohooo!! It worked! I used my buzzer instead of an LED so I wouldn't have to be staring at the circuit! Okay, now that I know this works, I need to know how to do a simple TV output. Does anyone have a bit of code they can post on how to just display, "hello world!" on a tv in order to test the port?

    Thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
  • SRLMSRLM Posts: 5,045
    edited 2009-05-07 20:18
    I like to use a program that outputs data to a terminal in order to determine if the chip is working okay.
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2009-05-07 20:18
    CON
    
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    
    
    OBJ
    
      text : "tv_text"
      
    
    PUB start 
      'start term
      text.start(12)
      text.str(string(13,"Hello World ... This is Vaati",13))
    
    



    Vaati - this assumes that you have a 5MHz crystal on your board ..

    Regards,
    John

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'

    Those who can, do.Those who can’t, teach.

    Post Edited (QuattroRS4) : 5/7/2009 8:23:39 PM GMT
  • VaatiVaati Posts: 712
    edited 2009-05-07 20:28
    It worked! I can play with that little snippet of code forever! Okay, moving on-- How do I get it to do that as well as have audio out on the tv?

    Thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2009-05-07 20:49
    Vaati,
    ······· You are 'moving on' too quickly .. there are loads of examples included with the IDE .. you will have to work through them .. It doesn't happen overnight ..

    I have attached a spin something that gives you tv text and sound ! ...enjoy

    Regards,
    ············ John


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'

    Those who can, do.Those who can’t, teach.
  • VaatiVaati Posts: 712
    edited 2009-05-07 20:57
    Oh wow. Thanks a lot for your code and help. I agree, I am kinda moving on too fast, but it is so I can check to see if all the ports work.

    Thanks again.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2009-05-07 21:02
    Vaati,
    I detect a bit of excitement - when you see results ! .. believe me we all felt that way .. but it would help to get a better understanding of the basics first.. Lots of people have great apps written .. SDCard,I2C,Graphics and Wav players etc.. All in good time .. enjoy..

    Regards,
    John

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'

    Those who can, do.Those who can’t, teach.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-05-07 22:07
    Vaati,

    Take your time to enjoy the journey.. I've been here nearly 3 years
    with this thing.. I'm still learning new and cool things all the time!

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
Sign In or Register to comment.