Shop OBEX P1 Docs P2 Docs Learn Events
How to Start hardware of 2Quick start board ...?? - Page 3 — Parallax Forums

How to Start hardware of 2Quick start board ...??

1356

Comments

  • RITESH KAKKARRITESH KAKKAR Posts: 254
    edited 2011-07-10 09:57
    sdfsdf.jpg
    Ariba wrote: »
    from the Propeller Manual (Page 101):


    Andy


    You can see it work in single curly bracket.............{}
    pencil.png
    1024 x 576 - 53K
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-07-10 13:02
    Ariba wrote: »
    from the Propeller Manual (Page 101):


    Andy

    I went to look this up in the Propeller Manual and couldn't find any information about comments on page 101.

    I initially looked in the newest version, 1.2, available from the help menu of the Propeller Tool.

    I did find the information about comments in my old manual (version 1.0) on page 101.

    I went to look for a more up to date reference, so I looked in the index of the Propeller Education Kit (v1.2).

    I found this:

    attachment.php?attachmentid=82861&d=1310325646

    I looked on page 47 and did not find anything about comments at all. Page 92 did have information about documentation comments.

    I think these type of events (looking in the wrong edition of a book or books not providing correct information) would be much more frustrating to those new to the Propeller than to those who are already familiar with the Prop. I'm sure this isn't a Prop specific issue but I think it would be good if forum members and Parallax tried (or continue to try) to minimize these type of mistakes. (Never mind, I'm sure most are already trying to provide clear information.)

    I just wanted to point out that sometimes "Read the documentation" is easier said than done. I still think people should read the documentation but it can be hard for us to remember how confusing all this was when it was new to us. (In my case it was just a few years ago so I remember having many of the words sail right over my head as I read "the documentation."

    I think it was Silva who told us native English speakers, how fortunate we are to have all the Propeller documentation in our native tongue.


    @Ritesh, Do you understand about using {} for comments? I wasn't sure from your last post. What did you want us to see in the screen shot of the Propeller code you posted? It looks like you were experimenting with comments. Is this correct?

    I hope the Propeller is starting to make a little more sense.

    I am very busy working on a project for my in-laws (my wife's parents). My father in-law is very ill and he might need help in the middle of the night so I'm working on this project.

    http://forums.parallax.com/showthread.php?132849-Propeller-Powered-Panic-Buttons

    I hope to finish the project in the fewest days possible.

    Mike Green (and others) has given you a lot of good advice. I think Mike likes people to find answers for themselves as much as possible because people learn more that way. I certainly agree with Mike's instructions to you about giving more information in your questions.

    I will still be watching this thread and I will help answer questions if I know the answer and if I have the time.

    Duane
    315 x 61 - 7K
  • AribaAriba Posts: 2,690
    edited 2011-07-10 19:28
    Sorry, I still use the Manual version 1.01

    Now I have downloaded the newest PropellerTool 1.3 to verify what you say. There has changed a lot.
    The Spin Programming Tutorial has moved to the Help file. In Lesson 3 -> Adding comments you find the Text I referred to.

    The question is why has RITESH not noticed that? Has he an old manual or just not looked into the manual?
    I think going thru the "Spin Programming Tutorial" is a good way for beginners to learn the basics of Spin. If you want it in PDF form instead of a helpfile then download the old Propeller manual 1.01 (still available on the download page).

    Andy
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-07-10 20:15
    Andy,

    I think using an older version of the manual in this case wasn't a problem since you quoted the paragraph in your post. I'm guessing you answered his question.

    So you know, the "helpfile" is a PDF. Best of both worlds!

    I'm not sure from what you wrote if you had seen the newest version of the manual. While the newest version doesn't have the tutorials anymore (they aren't really needed since we now have the PEK), the PASM section is much better IMO. The examples with each PASM instruction made learning to program with PASM much easier than if I had to rely on the old manual.

    Duane
  • RITESH KAKKARRITESH KAKKAR Posts: 254
    edited 2011-07-10 20:45
    What did you want us to see in the screen shot of the Propeller code you posted? It looks like you were experimenting with comments. Is this correct?

    hi again,
    I was checking when comment are written in between not at right or left, in multi lines also then also there is no error shown.
    then what will be the different left in both and single curly bracket both are working same....
  • kuronekokuroneko Posts: 3,623
    edited 2011-07-10 20:55
    The propeller tool has 4 display modes (Full Source, Condensed, Summary, Documentation). Paste the following into the proptool, switch modes and note the difference(s).
    PUB null
    {{
      comment one
    }}
    {
      comment two
    }
      main
      
    PUB main
    DAT
    
  • RITESH KAKKARRITESH KAKKAR Posts: 254
    edited 2011-07-11 09:02
    The propeller tool has 4 display modes (Full Source, Condensed, Summary, Documentation). Paste the following into the proptool, switch modes and note the difference(s).

    Thanks sir, for clearing my doubt.....!!
  • RITESH KAKKARRITESH KAKKAR Posts: 254
    edited 2011-07-11 09:09
    OK, today i have got some more doubt after searching , reading,etc...
    I want to know how to use CLKMODE, i know the difference in _CLKMODE and CLKMODE but how to use it as i have seen doc. it that it was written MODE := CLKMODE but my doubt about this instruction is not clear. mean, how to use this instruction as there are clock registers........in QS.
    and other question is !outa use ??
  • LeonLeon Posts: 7,620
    edited 2011-07-11 09:23
    See page 67 of the Manual.
  • RITESH KAKKARRITESH KAKKAR Posts: 254
    edited 2011-07-11 09:30
    See page 67 of the Manual.

    MODE := CLKMODE but how to read MODE it bit wise??
  • RITESH KAKKARRITESH KAKKAR Posts: 254
    edited 2011-07-11 09:36
    See page 67 of the Manual.

    MODE := CLKMODE but how to read MODE it bit wise??
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-07-11 09:48
    OK, today i have got some more doubt after searching , reading,etc...
    I want to know how to use CLKMODE, i know the difference in _CLKMODE and CLKMODE but how to use it as i have seen doc. it that it was written MODE := CLKMODE but my doubt about this instruction is not clear. mean, how to use this instruction as there are clock registers........in QS.
    and other question is !outa use ??

    I'm not completely clear on these things myself.

    I generally just use the Prop at 80MHz and just include this in the beginning of the parent object.
    CON
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    

    The QuickStart demo program used this to set the clock speed.
    CON
      _CLKMODE = XTAL1 + PLL16X
      _CLKFREQ = 80_000_000
    

    Apparently the two piece of code do the same thing.

    I believe the above code sets the clock registers. I myself never change the clock registers directly.

    Is there something you are trying to do that requires changing the clock registers?

    The QS board has a 5MHz crystal so you should not need to use something different than:
    _xinfreq = 5_000_000
    

    You can change the clock mode. I sometimes use RCSLOW or RCFAST. I also change the PLL to a lower multiplier if I'm using a logic analyzer and I want slow a program down.

    I would suggest exmerimenting with blinking an LED at certain rate and see if the LED really does blink at the rate you think you programmed it.

    Duane
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-07-11 09:57
    MODE := CLKMODE but how to read MODE it bit wise??

    Do you really need to read the clock mode bits?

    The Prop has bit manipulation operators, "|<" and ">|" are two of them. They are on page 160 of the manual.

    Using specific bits is a little awkward with the Prop. I'll try to find some links to some example code. You ought to try to search the forum also. I haven't thought of good search words myself yet. Try "bit manipulation".

    I know JonnyMac has some bit manipulation code. If you can't find it or if others don't post it, I'll look for it.

    Duane
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-07-11 10:06
  • RITESH KAKKARRITESH KAKKAR Posts: 254
    edited 2011-07-11 10:17
    I study PLL is used in Receivers to decode signal, but i am listening first time it is used as freq. multipliers in QS..........is this true??
  • mindrobotsmindrobots Posts: 6,506
    edited 2011-07-11 10:53
    Ritesh,

    At this point, you have so much more to learn about programming the Propeller, don't concentrate too much on the clock and the PLL and the clock mode. Use the code given above to set the clock and start working through the tutorial exercises. These clock setting will work 95% of the time for all programs. There is much more to learn and when you need to change the clocking, it will make more sense with the foundation of Propeller programming you've learned by reading and practicing all of teh information given to you in the posts above.

    You aren't going to learn to program the Prop from watching a video. You will learn by loading the software on your PC, reading the manuals, working through the tutorials and looking at example code just like all the rest of us did.

    When you have a specific question or have read everything and still don't understand, the forum members will be more than helpful if you are specific in your questions.

    One of your questions is about the !outa and what it does. As with any programming language, you need to read through the manual and understand the operators and keywords. If you had done this, you probably would not have asked that question. I opened the Propeller Tool, opened the Propeller Manual .pdf fromteh Help menu and went the section on Unary Operators and found '!' to be a Bitwise NOT. I looked through the index and found OUTA to be a SPIN keyword with 3 pages of description and examples and then did a search on !OUTA and found a commented example of code using that construct. The information is there but you are going to need to study and read the manuals.

    Welcome to the Propeller Forum! Keep reading & good luck!
  • AribaAriba Posts: 2,690
    edited 2011-07-11 11:06
    PLLs are just a way to multiply a given frequency by a factor. This can be used in Receivers but also most new uCs use it to generate a high stable frequency from a low cost crystal.

    If you want see the bits of CLKMODE you can write the register to the 8 LEDs of the QuickStart board:
    _xinfreq = 5_000_000
    '  _clkmode = rcfast
    '  _clkmode = rcslow
    
      _clkmode = xtal1 + pll16x
    '  _clkmode = xtal1 + pll8x
    '  _clkmode = xtal1 + pll4x
    '  _clkmode = xtal1 + pll2x
    '  _clkmode = xtal1 + pll1x
    
    PUB main  | b7
      dira[23..16]~~                'LED pins = outputs
      outa[23..16] := clkmode       'write CLKMODE bits to the 8 LEDs
      b7 := clkmode>>7 & 1          'read bit7 of clkmode to variable
      repeat 
    
    You can uncomment different modes and see how the LEDs will get changed.
    The last line before repeat shows also how to isolate single bits from a byte.

    Andy
  • RITESH KAKKARRITESH KAKKAR Posts: 254
    edited 2011-07-14 09:43
    Hello,

    I want to ask one more stupid question, can we read the old program that is stored in EEPROM ??
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-07-14 09:56
    I think there are a couple of ways to read the program from the EEPROM.

    I believe BST has a feature to do this directly. I have never tried it and don't know how to do it.

    You can also use the Propeller to read the EEPROM. This thread discusses reading and writing the EEPROM.

    http://forums.parallax.com/showthread.php?97625-PE-Kit-Lab-Applications-–-EEPROM-Datalogging-and-I2C&p=678271


    Some more about clock mode: I just used the program "Clock" for the first time. "Clock" is in the Propeller Tool's library folder. It makes it easier to change the clock mode from inside your program.

    There is a lot of good information in the "THEORY OF OPERATION" section of the program.

    Duane
  • kuronekokuroneko Posts: 3,623
    edited 2011-07-14 16:31
    Duane Degn wrote: »
    Some more about clock mode: I just used the program "Clock" for the first time. "Clock" is in the Propeller Tool's library folder. It makes it easier to change the clock mode from inside your program.
    Be aware that version 1.1 is slightly broken when you try to go from RCSLOW to PLL mode. I posted a fix here [post=1003139]somewhere[/post] (the setclock method needs minimum waitcnt protection).
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-07-14 17:54
    kuroneko,

    Thank you. The bug is still there in library of the Propeller Tool v1.3.

    I haven't needed to change the clock speed within the program before. I think I would have had a problem without your help.

    Duane
  • RITESH KAKKARRITESH KAKKAR Posts: 254
    edited 2011-07-14 19:50
    can we read the old program that is stored in EEPROM ??

    The EEPROM is of QS board, not external...........
  • RITESH KAKKARRITESH KAKKAR Posts: 254
    edited 2011-07-15 08:39
    Is there any method to read the code (program) that is stored in QS board ??
  • Mike GreenMike Green Posts: 23,101
    edited 2011-07-15 09:10
    Yes. There are several programs that have EEPROM routines. DongleBasic (in the Object Exchange) is one of them. There's a DUMP command described in the included documentation that will display the contents of RAM, ROM, or EEPROM. The EEPROM doesn't have to be the one used to hold the program. You can attach a standard serial EEPROM to any available pair of I/O pins and DongleBasic can read or write it. You can download DongleBasic to RAM and dump the program currently in the first 32K of the EEPROM.
  • RITESH KAKKARRITESH KAKKAR Posts: 254
    edited 2011-07-16 21:24
    There's a DUMP command described in the included documentation that will display the...............

    Hey, i don't find this command in help file..........
  • kuronekokuroneko Posts: 3,623
    edited 2011-07-16 22:25
    Hey, i don't find this command in help file..........
    I'm curious. What steps did you take (not) finding the command description?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-07-16 23:12
    Ritesh,

    I'm curious why you want to read the attached EEPROM.

    Is it just so you can learn how?

    I loaded the EEPROM with a demo program that uses the QuickStart's touch pads and LEDs before I sent the QS to you.

    I'm attaching a program that will dump the EEPROM contents and display it in a similar manner to "RUN | Compile Current | View Info... F8".

    The baud rate is set to 57600. You'll need to press a key on the keyboard to start the program. The contents of the EEPROM is dumped in 512 byte blocks. You'll need to press a key after each block is displayed to see the next block.

    This should get you started with reading serial EEPROMs.

    Here's the code:
    CON
      _CLKMODE = XTAL1 + PLL16X
      _CLKFREQ = 80_000_000
      _MaxEepromAddress = $7FFF ' = 32,767
      _BufferSize = $200 ' = 512
      _DebugBaud = 57600
      _NumberOfColumns = 16
     
    VAR
      word eepromIndex, bufferIndex, groupIndex
      byte buffer[_BufferSize]
     
    OBJ
      Eeprom : "Propeller EepromDWD"
      Debug : "fullduplexserial"
    PUB Main | localIndex
      Debug.start(31, 30, 0, _DebugBaud)
      waitcnt(clkfreq / 1000 + cnt) ' wait for serial driver cog to start
     
      eepromIndex := 0
      groupIndex := 0
      ' The code below check to see if a key has been pressed 10 times a second.
      ' It displays the message "Press any key to start." every four seconds.
      ' I use it so I don't have to hurry to open the Parallax Serial Terminal.
      ' I also don't have to wait more than a tenth of a second to start the program.
      repeat while debug.rxcheck == -1
        if result++ // 40 == 0 ' result is a temporary variable all methods have.
          Debug.str(String(13, "Press any key to start."))
        waitcnt(clkfreq / 10 + cnt) ' This line waits a tenth of a second
     
     
      Debug.str(String(13, 13, "Beginning of EEPROM dump."))
      Debug.str(String(13, "Values are in hexadecimal.", 13))
     
      repeat
    '' -------------- Beginning of heading and formatting stuff ----------------  
        Debug.str(String(13, "Group $"))
        Debug.hex(groupIndex++, 4)
        Debug.str(String(".  Starting at EEPROM location $"))
        Debug.hex(eepromIndex, 4)
        Debug.tx(13)
        Debug.str(String(13, "Base  "))
        repeat _NumberOfColumns
          Debug.str(String(" + ")) 
        Debug.str(String(13, "Addr  "))
        repeat localIndex from 0 to _NumberOfColumns - 1
          Debug.tx(32)
          Debug.hex(localIndex, 2)
        Debug.str(String(13, "______"))
        repeat _NumberOfColumns
          Debug.str(String("___")) 
        Debug.tx(13)  
    '' -------------- End of heading and formatting stuff ----------------  
     
        Eeprom.ToRam(@buffer, @buffer + _BufferSize - 1, eepromIndex)
        bufferIndex := 0
        repeat
          Debug.hex(eepromIndex, 4)
          Debug.tx(32) ' a space character 
          Debug.tx("|") 
          repeat _NumberOfColumns
            Debug.tx(32) ' a space character  
            'Debug.tx("$")
            Debug.hex(buffer[bufferIndex++], 2)    
     
          Debug.tx(13)
          eepromIndex += _NumberOfColumns 
        while bufferIndex =< _BufferSize - 1
        Debug.str(String(13, "Press any key to continue."))
        repeat while debug.rxcheck == -1 
      while eepromIndex < _MaxEepromAddress
      Debug.str(String(13, 13, "End of EEPROM dump."))
      Debug.str(String(13, "_MaxEepromAddress = $"))
      Debug.hex(_MaxEepromAddress, 4)
      Debug.str(String(13, "_BufferSize = $"))
      Debug.hex(_BufferSize, 4)
      Debug.str(String(13, "_NumberOfColumns = $"))
      Debug.hex(_NumberOfColumns, 2)
    DAT
    '' This data is to make the EEPROM dump a little more interesting
    '' if F11 (program loaded to EEPROM) is pressed.
    testBufferA   byte $AA[$400]
    testBufferB   byte $BB[$800]
    testBufferC   byte $CC[$200]
    testBufferD   byte $DD[$600]
    testBufferE   byte $EE[$500]
    testBufferF   byte $FF[$700]
    

    In order to see the contents of a different program, you'll need to make sure and only load the RAM with this program (F10 key).

    I modifed the basic Propeller Eeprom program to release the I2C lines after each call. I wasn't able to use other I2C devices on the same lines with the original code.

    Duane
  • HShankoHShanko Posts: 402
    edited 2011-07-16 23:28
    @ Duane,

    Interesting. I'll have to try your program. I understand the FullDuplexSerial use, but what is the display device? One's own computer with some app to receive and display the info? I've not yet gotten into this debug aspect yet. It sounds like one needs a monitor. I have a QuickStart board and realize it is pretty powerful for its small size. I've made a mezzanine board to i/f TVout and plan to also include a 24 x 1 LCD I got a few years ago but never used.
  • RITESH KAKKARRITESH KAKKAR Posts: 254
    edited 2011-07-16 23:39
    What steps did you take (not) finding the command description?

    In propeller help>search
  • kuronekokuroneko Posts: 3,623
    edited 2011-07-16 23:43
    In propeller help>search
    I think you'll have more success downloading DongleBasic (in the Object Exchange) and looking in the provided manual.
Sign In or Register to comment.