Shop OBEX P1 Docs P2 Docs Learn Events
Some questions : Code Protection, instructions timing... — Parallax Forums

Some questions : Code Protection, instructions timing...

octaloctal Posts: 67
edited 2008-04-13 08:45 in Propeller 1
Hi,
I'm new to propeller and I was really estonished by the powerfull architecture of this chip. Really great! All my congratulation to Parallax team.

I'm playing a bit with propeller programming in ASM, and I wanted to ask for some questions:

1- How can we evaluate (or any doc) the number of cycles that will take any asm code, or asm instruction? (in synchronous execution in the same cog of course) I want to make some digital data acquisition at fast rates (about 60 MHz) and measuring data acquisition rates is mandatory for that !!!!

2- Is there anyway to protect the firmware? I want to use propeller for some commercial products and code protection is really mandatory for me. any proposition or hint ?

3- Where to find documentation on propeller comm protocol (with PC) when loading the firmware at startup (during programming)?


Best regards
octal

Comments

  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-04-11 10:01
    Welcome to the forums octal.

    1-The data sheet is here www.parallax.com/tabid/442/Default.aspx and has the instruction timings in it. Basically hub instructions take between 7 and 22 cycles, jump instructions take 8 cycles if the don't jump and 4 if they do, wait instructions take a minimum of 5 cycles and all others should take 4 cycles.

    2-Not easily. This has come up repeatedly in the forums here and you should be able to find the discussions using the search. On that, use this link to search search.parallax.com

    3-There is not an official document but this page has the details. propeller.wikispaces.com/Download+Protocol

    Data acquisition at 60MHz could be difficult. It is possible to collect data at 80MHz by using 4 cogs properly syncronized but this does not allow for doing any processing on the data. You could use 3 cogs to get an average of 60MHz but it won't be evenly spread out over the time period.


    Hope this helps
  • hippyhippy Posts: 1,981
    edited 2008-04-11 12:29
    With an XIN oscillator source of 60MHz, that should allow 60MHz sampling using 4 Cogs.
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-04-11 12:52
    True, you could also use a 7.5Mhz crystal with 8xPLL or 3.75MHz crystal with 16xPLL. Don't know if you can get crystals with those values though.
  • octaloctal Posts: 67
    edited 2008-04-11 14:22
    Thanks all for your answers. That's great [noparse]:)[/noparse]


    1- I found the details of instructions in the manual. I printed full manual .. and I'll order the official book as I prefer to keep a clean copy at hand of the reference manual.

    2- I read all posts about code protection, this is why I was searshing for the comm protocol between PC and Propeller. I want to make a full programmer using PIC, and the program will be hidden inside PIC. During execution, the propeller program will contain an asymetric encryption algorithm, an algorithm for which one part of the key is available in the propeller soureces, and the other part of the key will be hidden in PIC side, and at startup, the propeller will load the program from the PIC, and it will use its key to calculate some data to be sent to the PIC, and the PIC will give him some necessary keys to unlock parts of the program. The aim is not to protect full program, a hacker can of course always hack the system and got the propeller program to work independent from a PIC, but the protection will also relay on the PIC because the full design I'll make will use also the PIC for some comm stuff (USB2). The PIC will act as a coprocessor for the propeller and will do some stuff on the board itself. Anyway, I would have prefered to have a protection fuse on the propeller, or some locked bytes that the PC use as a key to encrypte the propeller soft, and the propeller can use to read and decrypt the external eeprom. I think that this kind of stuff can bring more industrial users to propeller world, and keep in mind, marketting guys do not think like tech guys: give them the term "LOCK BYTES" or "PROTECTIONS FUSES" and they will pay or sell 100 times without even asking about the protection strongness !!!
    stevenmess2004 said...
    Welcome to the forums octal.

    Data acquisition at 60MHz could be difficult. It is possible to collect data at 80MHz by using 4 cogs properly syncronized but this does not allow for doing any processing on the data. You could use 3 cogs to get an average of 60MHz but it won't be evenly spread out over the time period.


    Hope this helps

    As for data acquisition, I can do it at 80Mhz ... but is there an example on how to do that anywhere ? I'll not do any processing on data, I need only take about 100 32 bit samples at a time, and send them to PC where a special program will do processing (fitting to experimental and theoretical experiment results)!!!

    Regards
    octal
  • LawsonLawson Posts: 870
    edited 2008-04-11 18:27
    mydancebot.com/viewport/ (will sample and upload the I/O pins at 80MHz among other things)

    Marty

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Lunch cures all problems! have you had lunch?
  • octaloctal Posts: 67
    edited 2008-04-11 19:50
    Lawson said...
    mydancebot.com/viewport/ (will sample and upload the I/O pins at 80MHz among other things)

    Marty

    Hi Marty,
    thanks. I already downloaded the ViewPort (having seeing it from the ThirdParty tools section of Parallax site).

    They provide a nice spin object to do sampling (mostly written in ASM for productive section). The problem is in computer side, if I reuse their object, I need to get data on my own application to be able to do costum processing on it (mainly numerical transformations and processed data will be reused by the same computer application to monitor and manage some automation tools - btw. my computer side application will run under QNX or EmbeddedLinux, not on PC platform). And as I have seen the ViewPort source codes are not offered even in registered version. How can I get data in computer side?

    Regards
    octal

    Post Edited (octal) : 4/11/2008 7:55:21 PM GMT
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-04-11 23:13
    If its any help someone implemented blowfish encryption on the propeller a while ago. To get the data to the pc you can use a serial port. There is a driver called FullDuplexSerial that will do up to 200-300kBits/s. However, it is possible to push the speed up to around 3Mbits/s using different drivers and one was posted recently.

    Probably the easiest way to protect your program is to cover the propeller and eeprom in an epoxy that will wreck the chips when taken off.
  • octaloctal Posts: 67
    edited 2008-04-13 08:45
    Ok.
    Thanks everyone, I searched and found codes on the forum. I'll try that.

    Thx again for your help.

    Regards
    octal
Sign In or Register to comment.