Reading DCC data using a propeller on track. (digital model railway control)

2»

Comments

  • Clock LoopClock Loop Posts: 1,374
    edited January 12 Vote Up0Vote Down
    I actually like what I see when I look at the prop scope its self as far as its probe circuitry and adc....

    I found some info about open scope ...

    They have some info...

    https://github.com/rosco-pc/OpenScope




    Hmm...
    To study the nature of randomness in a digital processor network using the same clock source, 54 prop chips were all connected to a master prop. http://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Optic communication between homogenous and commensurable, 8-core, 635nm emitting, phase locked loop, bit salad tossing units? http://forums.parallax.com/discussion/comment/1248240/#Comment_1248240
    TheBlackBox: Release v2.0 - Propeller HSS FX/Sequencer with Digital Audio SPDIF output. http://forums.parallax.com/discussion/115258/theblackbox-release-v2-0-propeller-hss-fx-sequencer-with-digital-audio-spdif
    E-Tools - Mono555 calculator, resistor calculator, voltage divider calculator, RCtime calculator, LM317 calculator, Binary-Hex-Decimal calculator, Resistor color matrix, Series LED resistance calculator, OHMS LAW calculator.
    http://forums.parallax.com/discussion/81449/e-tools-html-java-script-electronic-design-tools-free-for-you
  • Clock LoopClock Loop Posts: 1,374
    edited January 16 Vote Up0Vote Down
    Using some of the propscope hardware (a2d) still requires me to code some software side.... But I am almost done with the schematic and making the pcb foot prints plus schematic parts.. Since I had to redo most of the propscope schematic, I did it all, plus the pcb.

    Now I get to hack it up to fit my need.

    So... to start I simply modified the parallax visual basic demo program for the propeller...
    To run on the propscope. (so nothing is happening in the code but the AN018 code minus its I/O operations, it just communicates with the pc at 2Mbaud.

    I had to find a full duplex serial plus object and Jonathan Dummer(lonesock) made one that has killer speeds using two cogs. NICE! THANKS!
    "Fast Full-Duplex Serial"
    http://forums.parallax.com/discussion/comment/1212013/#Comment_1212013

    Heres v1 of FFDS1
    http://forums.parallax.com/discussion/143514/fast-full-duplex-serial-1-cog-a-k-a-ffds1



    But the data that the VB program is receiving/sending is super slow, the code is too slow, so i will need to work on that, (serial port needs to be made into a stream object or something, not sure, gotta read more)

    http://www.parallax.com/downloads/an018-communication-pc-application

    So some code changes are needed. Along with how the serial port is used, its very slow as you can see by the video.
    The data on the propside and over the serial, is going much faster than 10hz, but this simplistic vb code only allows that. (the serial function is triggered only every 20ms due to vb timer limits. I don't know enough yet about vb to make it show the 2mbit data displaying rate.

    To study the nature of randomness in a digital processor network using the same clock source, 54 prop chips were all connected to a master prop. http://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Optic communication between homogenous and commensurable, 8-core, 635nm emitting, phase locked loop, bit salad tossing units? http://forums.parallax.com/discussion/comment/1248240/#Comment_1248240
    TheBlackBox: Release v2.0 - Propeller HSS FX/Sequencer with Digital Audio SPDIF output. http://forums.parallax.com/discussion/115258/theblackbox-release-v2-0-propeller-hss-fx-sequencer-with-digital-audio-spdif
    E-Tools - Mono555 calculator, resistor calculator, voltage divider calculator, RCtime calculator, LM317 calculator, Binary-Hex-Decimal calculator, Resistor color matrix, Series LED resistance calculator, OHMS LAW calculator.
    http://forums.parallax.com/discussion/81449/e-tools-html-java-script-electronic-design-tools-free-for-you
  • Clock LoopClock Loop Posts: 1,374
    edited January 17 Vote Up0Vote Down
    So you think you're getting past a problem, and a new one shows.... hmm perhaps 2Mbit of data dumping into the vb buffer of 1024... might not be so good.. and when i turn the port off... no over flow... hmmm

    One would hope the modern visual studio would have better debugging ability.. but it just says that debugging isn't possible.
    So some debugging info does show in that popup, but not much, you havta kinda know what your program is doing to guess what its doing wrong.
    2018 and ms debugger still just as useless. Its also possible im doing something wrong, or the free version of studio dosen't allow it.

    Hmm., actually this looks like im overloading my send buffer...
    stackoverflow.jpg


    This post is still yet another post spam as a result of not being able to add attachments to previous posts.
    802 x 148 - 27K
    To study the nature of randomness in a digital processor network using the same clock source, 54 prop chips were all connected to a master prop. http://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Optic communication between homogenous and commensurable, 8-core, 635nm emitting, phase locked loop, bit salad tossing units? http://forums.parallax.com/discussion/comment/1248240/#Comment_1248240
    TheBlackBox: Release v2.0 - Propeller HSS FX/Sequencer with Digital Audio SPDIF output. http://forums.parallax.com/discussion/115258/theblackbox-release-v2-0-propeller-hss-fx-sequencer-with-digital-audio-spdif
    E-Tools - Mono555 calculator, resistor calculator, voltage divider calculator, RCtime calculator, LM317 calculator, Binary-Hex-Decimal calculator, Resistor color matrix, Series LED resistance calculator, OHMS LAW calculator.
    http://forums.parallax.com/discussion/81449/e-tools-html-java-script-electronic-design-tools-free-for-you
  • Debugging is a bear no matter the tools you have. Single stepping and logic analyzers work but are incredibly slow. Software debuggers are not much better unless you have some idea of where the problem is. Debug statements or breakpoints in modules and subroutines help but are tedious to add.

    One of the neatest ideas back in the day was adc's on the address bus and an oscilloscope in xy mode to see where the program was executing. Later the ADC's and scope were replaced by decoders and leds. Of course that required an external address bus that could be accessed so it is not much use on today's microcontrollers.
    In science there is no authority. There is only experiment.
    Life is unpredictable. Eat dessert first.
  • Clock LoopClock Loop Posts: 1,374
    edited January 17 Vote Up0Vote Down
    kwinn wrote: »
    One of the neatest ideas back in the day was adc's on the address bus and an oscilloscope in xy mode to see where the program was executing.

    Gonna havta try that one day...


    I found that the vb project that I based this project on has an old version of CLR put into a config file...
    programname.vbproj Has a line in it that looks like this...
    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
    

    If your file has a version that is older, then you need to replace your version, with v4.6.1 in your programs .vbproj file.
    Thats assuming you in fact do use the latest visual studio with the latest .net dev framework installed.

    This allows debugging while running the program live(you can change the code) if you are on a 64-bit cpu.
    (you must turn off native code debugging in the debugger engines) located in your project properties page.)


    This is funny, so i did all this to make my clr version able to debug and change code live, but it then says changes are not allowed while running lol. BUT at least my cpu and memory profiler both work now... From what I read, the live code debugger/change dosen't work anyway.
    But its nice that my code is now using a later clr version. That is an important thing if your code can handle the new version, it makes sense why the clr didn't automatically change with the new version installed, but when I loaded the old project in vb, studio should have asked me if I want to use the latest version of clr with my project.

    Meh.
    To study the nature of randomness in a digital processor network using the same clock source, 54 prop chips were all connected to a master prop. http://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Optic communication between homogenous and commensurable, 8-core, 635nm emitting, phase locked loop, bit salad tossing units? http://forums.parallax.com/discussion/comment/1248240/#Comment_1248240
    TheBlackBox: Release v2.0 - Propeller HSS FX/Sequencer with Digital Audio SPDIF output. http://forums.parallax.com/discussion/115258/theblackbox-release-v2-0-propeller-hss-fx-sequencer-with-digital-audio-spdif
    E-Tools - Mono555 calculator, resistor calculator, voltage divider calculator, RCtime calculator, LM317 calculator, Binary-Hex-Decimal calculator, Resistor color matrix, Series LED resistance calculator, OHMS LAW calculator.
    http://forums.parallax.com/discussion/81449/e-tools-html-java-script-electronic-design-tools-free-for-you
  • Clock LoopClock Loop Posts: 1,374
    edited January 17 Vote Up0Vote Down
    I think this thread might need a warning image, its starting to get ....

    learncurve.jpg
    440 x 485 - 18K
    To study the nature of randomness in a digital processor network using the same clock source, 54 prop chips were all connected to a master prop. http://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Optic communication between homogenous and commensurable, 8-core, 635nm emitting, phase locked loop, bit salad tossing units? http://forums.parallax.com/discussion/comment/1248240/#Comment_1248240
    TheBlackBox: Release v2.0 - Propeller HSS FX/Sequencer with Digital Audio SPDIF output. http://forums.parallax.com/discussion/115258/theblackbox-release-v2-0-propeller-hss-fx-sequencer-with-digital-audio-spdif
    E-Tools - Mono555 calculator, resistor calculator, voltage divider calculator, RCtime calculator, LM317 calculator, Binary-Hex-Decimal calculator, Resistor color matrix, Series LED resistance calculator, OHMS LAW calculator.
    http://forums.parallax.com/discussion/81449/e-tools-html-java-script-electronic-design-tools-free-for-you
  • Clock LoopClock Loop Posts: 1,374
    edited January 17 Vote Up0Vote Down
    Delegates? Did microsoft frame its vb code structure from a convention?
    Delegate.jpg


    Well, some progress.. much faster serial interfacing code... not sure if its at its max yet... (as far as spin)
    505hz ... the amount of serial cycles my program goes through in a second.
    (a serial cycle includes the entire serial data packet of
    myheader      Byte    "!P1", 10, 0
    
    Thats seriously fast for a human interface, but seriously slow for any kind of data stream.
    Its a good thing i don't know what im doing in vb, because those numbers are entirely too slow to be 2mbit if I understand how much data i am dealing with per serial cycle.


    speed.jpg
    552 x 327 - 43K
    776 x 319 - 83K
    To study the nature of randomness in a digital processor network using the same clock source, 54 prop chips were all connected to a master prop. http://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Optic communication between homogenous and commensurable, 8-core, 635nm emitting, phase locked loop, bit salad tossing units? http://forums.parallax.com/discussion/comment/1248240/#Comment_1248240
    TheBlackBox: Release v2.0 - Propeller HSS FX/Sequencer with Digital Audio SPDIF output. http://forums.parallax.com/discussion/115258/theblackbox-release-v2-0-propeller-hss-fx-sequencer-with-digital-audio-spdif
    E-Tools - Mono555 calculator, resistor calculator, voltage divider calculator, RCtime calculator, LM317 calculator, Binary-Hex-Decimal calculator, Resistor color matrix, Series LED resistance calculator, OHMS LAW calculator.
    http://forums.parallax.com/discussion/81449/e-tools-html-java-script-electronic-design-tools-free-for-you
  • Clock LoopClock Loop Posts: 1,374
    edited January 18 Vote Up0Vote Down
    I guess I am in fact re-writing the propscope software,.. after all..

    So I purchased a few prop scopes to have more than 2 channel on screen...
    propscopeVB.jpg


    Yea, not gonna happen....

    From what I can tell, hanno is MIA. Before diggin into this vb and stuff, I tried to reach out to hanno for support on my developer copy of his viewport, but some of his websites are shut down, the forms on sites that do work, the contact page show no email, and doesn't even work... the latest site has the same form for support as the one on the viewport page(the viewport one dosen't work)....

    Seriously, multiple instances is literally a check box in vb, sure database might be an issue if its used with multiple instance,,,, but is it even used with propscope...

    Yawn.... Time to reinvent the same wheel that oh i dunno 40 other people did... but this time, its open source. no more redoing THIS wheel. Its just gonna take me a long time to do... I have noticed here in the forums, much support for the prop and the code... so ... i think i'll continue to tackle the vb pc side of the interface,,,
    I guess I should make the interface look like a scope to begin.. that part is easy.. the functional code.. not so...

    But after seeing that multiple instance error, I see the propscope was also written (ironically) in vb.
    So my task here is most likely possible, but talk about a mountain to climb.

    The prop scope software... Streaming is BUGGED, the Tools-->manage prope is BUGGED, the dial for the resolution is BUGGED, ZOOM and PAN...heh... dont even try those, etc...

    Do I want to do this? No, it makes it easier for the propscope to be copied, but this software has ran me into a brick wall for the last DAMN time.
    But don't think making abandon-ware is a very nice thing to do to products that are still on the market.


    The hardware alone tho is worth it, especially when they are on sale for 50% off. Nice probes, nice bnc connectors, the usb cable feels like it has nice conductors inside...

    In my opinion, the propscope is a hardware product for developers who wish to make hardware like it, or software to run it.....,it also has "free" software for demonstration of the hardware, free usually means no support.

    Also the propscope is a great platform for testing 6.25mhz programs, the pcb is a 4 layer pcb with ground planes, the analog and digital grounds are separated(for the most part).
    It has a metal body for better shielding...


    Anyway.. for those that hate vb.....
    Don't worry, i'll port it. :D
    And if I can't, I'll rewrite it in c once i do the more simple vb. (i found lots of opensource vb scopes that have tons of functions to be ripped)
    Me and whos army?



    "You want me to hack the planet? You're dreamin', pal! Oh, there are Hot Pockets involved? Time to get serious."


    I'll just end up with vb code that looks like this...
    1*RXbCXaeMjkt3wnl34NcgoQ.png

    And then finally realize what kind of learning curve I have encountered.

    1*m381A1XUItlhwHat_OIqoA.png
    476 x 434 - 50K
    To study the nature of randomness in a digital processor network using the same clock source, 54 prop chips were all connected to a master prop. http://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Optic communication between homogenous and commensurable, 8-core, 635nm emitting, phase locked loop, bit salad tossing units? http://forums.parallax.com/discussion/comment/1248240/#Comment_1248240
    TheBlackBox: Release v2.0 - Propeller HSS FX/Sequencer with Digital Audio SPDIF output. http://forums.parallax.com/discussion/115258/theblackbox-release-v2-0-propeller-hss-fx-sequencer-with-digital-audio-spdif
    E-Tools - Mono555 calculator, resistor calculator, voltage divider calculator, RCtime calculator, LM317 calculator, Binary-Hex-Decimal calculator, Resistor color matrix, Series LED resistance calculator, OHMS LAW calculator.
    http://forums.parallax.com/discussion/81449/e-tools-html-java-script-electronic-design-tools-free-for-you
  • Sometimes it is easier (and better) to analyze the old software or interface to discover the basic functions it performs and then use a modern well supported language you are familiar with to reproduce those functions.
    In many cases I have discovered that the effort needed to understand software someone else wrote well enough to make changes to it has been much greater than it would have been to start from scratch.
    In science there is no authority. There is only experiment.
    Life is unpredictable. Eat dessert first.
  • kwinn wrote: »
    Sometimes it is easier (and better) to analyze the old software or interface to discover the basic functions it performs and then use a modern well supported language you are familiar with to reproduce those functions.
    In many cases I have discovered that the effort needed to understand software someone else wrote well enough to make changes to it has been much greater than it would have been to start from scratch.

    I even found out that the same applies to software I wrote myself 25+ years ago...

    Mike

    I am just another Code Monkey.
    A determined coder can write COBOL programs in any language. -- Author unknown.
    Press any key to continue, any other key to quit

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
  • I haven't looked at Hanno's Software in detail, but the Software loads the PropScope every time, it is supposed just to have Calibrations in ROM.

    So we are able to intercept the load and catch a binary. The important part will be in assembler and it should not be soo problematic to find cog-images.

    Has anyone a P1 disassembler? Never thought about that before.

    Enjoy!

    Mike
    I am just another Code Monkey.
    A determined coder can write COBOL programs in any language. -- Author unknown.
    Press any key to continue, any other key to quit

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this post are to be interpreted as described in RFC 2119.
  • Clock LoopClock Loop Posts: 1,374
    edited January 18 Vote Up0Vote Down
    Umm, I would say, that you probably shouldn't disassemble the current software for the propscope or the binary.

    Clearly up to this point the writer of the software has failed to see the benefit that opensource gains you in the long run.
    And such, has chosen to not open it.

    SO technically, reverse engineering it and using the current binary could be illegal if I chose to base this project on any of it.

    I am not basing this software on anything related to the current propscope software, the fact that its VB is MERELY COINCIDENTAL (parallax offered AN018, which contains the vb code that this project is based on.)


    I see what you mean tho, the FUNCTIONS the hardware does is not dependent on the software, and documenting those functions using the free software is what you are talking about.

    I plan to do much more than the propscope software allows, since i am seeing so many o-scope vb opensource programs with all the code already done for all those functions.

    Time to adapt it all, and then write spin/pasm code to do it.


    I am, in fact, rewriting the pc software and the prop scope hardware (but like you say i will use OPENSOURCE code that I find on the net from other peoples vb oscopes.)

    Unless the writer of the current binary just opens it, its pointless to rev engineer it when that still limits you to using a locked packed binary.



    I want to, and am going to, make the propscope firmware a modifiable thing, with the possibility that a communication protocol could be used that aligns with labview protocols.

    I AM going to need LOTS of help making the firmware and software as my programming techniques knowledge isn't polished, right now im "opening a can of beans with a rock".

    I have looked into the subject of using the current firmware, ....

    I don't know what I would do if I couldn't read the prop code that I have written, and still figure out whats going on for the vb computer side of the link.

    Without seeing the Prop code(and inserting debugging), so you can identify issues with your own code, its virtually pointless to use locked firmware.
    From what I can tell, you knowing programming, know that its probably easier just to re-write the prop firmware.

    Plus then its all open and can be improved upon by the community. (and will probably be, since I am not fluent in algorithmics.)
    To study the nature of randomness in a digital processor network using the same clock source, 54 prop chips were all connected to a master prop. http://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Optic communication between homogenous and commensurable, 8-core, 635nm emitting, phase locked loop, bit salad tossing units? http://forums.parallax.com/discussion/comment/1248240/#Comment_1248240
    TheBlackBox: Release v2.0 - Propeller HSS FX/Sequencer with Digital Audio SPDIF output. http://forums.parallax.com/discussion/115258/theblackbox-release-v2-0-propeller-hss-fx-sequencer-with-digital-audio-spdif
    E-Tools - Mono555 calculator, resistor calculator, voltage divider calculator, RCtime calculator, LM317 calculator, Binary-Hex-Decimal calculator, Resistor color matrix, Series LED resistance calculator, OHMS LAW calculator.
    http://forums.parallax.com/discussion/81449/e-tools-html-java-script-electronic-design-tools-free-for-you
  • Clock LoopClock Loop Posts: 1,374
    edited January 19 Vote Up0Vote Down
    Speed, yum. Hey, this is kinda fun. Thanks to all the people who put code on the net to let people learn.

    I don't mind causing arithmetic overflows... when im testing the loop speed possibilities of multi threads...
    I guess i can't turn the thread.sleep(0) off.
    (i didn't realize telling a thread to sleep for 0 would have any difference... i guess its the sleep function its self, preventing the overflow)

    I suppose no delay counting loops are the next step for better granularity... state machines with threading.

    Perhaps im missing it but i see no built in function in vb with a sleep of less than 1ms. Thats funny.

    sleepthread.jpg

    Time to get the send and receive loops in their own threads.. that should speed things up alot...

    Gotta love having 1.6ghz looping capability... mmmm threading...

    My variables are smoking...

    1.6ghzVariable.jpg
    442 x 141 - 16K
    761 x 301 - 82K
    To study the nature of randomness in a digital processor network using the same clock source, 54 prop chips were all connected to a master prop. http://forums.parallax.com/discussion/127983/55-parallax-propeller-s-parallells-processing-of-permanent-perturbations/p1
    Optic communication between homogenous and commensurable, 8-core, 635nm emitting, phase locked loop, bit salad tossing units? http://forums.parallax.com/discussion/comment/1248240/#Comment_1248240
    TheBlackBox: Release v2.0 - Propeller HSS FX/Sequencer with Digital Audio SPDIF output. http://forums.parallax.com/discussion/115258/theblackbox-release-v2-0-propeller-hss-fx-sequencer-with-digital-audio-spdif
    E-Tools - Mono555 calculator, resistor calculator, voltage divider calculator, RCtime calculator, LM317 calculator, Binary-Hex-Decimal calculator, Resistor color matrix, Series LED resistance calculator, OHMS LAW calculator.
    http://forums.parallax.com/discussion/81449/e-tools-html-java-script-electronic-design-tools-free-for-you
Sign In or Register to comment.