3 Replies Latest reply on Jun 27, 2016 12:13 PM by Intel Corporation

    Migrating legacy 80C52 assembly code to Edison

    dStruct619

      Hello all,

       

      I'm new to the forums here, and I have a question.

       

      I have a very very old 80C52 based "Technology 80" PLC which we use for real-time interrupt driven first order mathematical modeling, which reads/writes/converts values of analog ADC and digital I/O pins.  I also have an Intel Edison Arduino board.

       

      My question is what options do I have if I wanted to try and run my legacy assembly code on the Edison?  Obviously it's not going to port right over and I think I would be reinventing the wheel so to speak if I tried to treat the Edison as a bare-metal device, since it is clearly not.

       

      Would it be possible to convert the code relatively easily to something higher level say C/C++ and still retain enough control over the code?

       

      I appreciate any insight or suggestions, thank you.

        • 1. Re: Migrating legacy 80C52 assembly code to Edison
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi,

          Your idea sounds very interesting, as you said there is no way of programming the Edison as a bare-metal device due to there is no documentation related to the registers and functions of it, and a way to program them.
          You can create your code with a higher level language, as you know there are a lot of libraries that will allow you to do this. For interfaces and pinout management I suggest you to use the MRAA library: http://iotdk.intel.com/docs/master/mraa/. If there are libraries that are not available on the board you can import them with gcc or cmake.
          Regarding the control over the code and board, it will depend on the resources you would like to use and the programming language too.
          My opinion for this is that you will need to check all the resources you will need in order to see the libraries that your project will require. 
          Probably there will be a lot of differences between your 80C52 and the Edison, but all doubts and questions you could have, you can ask in the communities, we will be glad to help you.

          Kind regards,
          Charlie
           

          1 of 1 people found this helpful
          • 2. Re: Migrating legacy 80C52 assembly code to Edison
            dStruct619

            Hi Charlie,

             

            Thank you for the reply, I had a feeling that would be the case.  I was hoping to find some way to either convert the code over, or more likely host the code within the Edison.  That may be an interesting side-topic, building some sort of legacy code hosting/emulation software to run on top.

             

            I'll probably just end up building something custom using a Silicon Labs EFM8 or similar.  My only issue if you could even call it that, is the analog out signals need to be able to do a differential +/- 10VDC.

             

            Either way, thanks.

            • 3. Re: Migrating legacy 80C52 assembly code to Edison
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hi,

              Unfortunately the ADC’s used on the Edison can’t be set for  a +/- 10VDC, it only will work for 5VDC or 3VDC. The Arduino Breakout board uses the ADS7951, you can check the datasheet here: http://www.ti.com/product/ADS7951
              This converter has:

              • 20 MHz clock rate
              • 12-bit A/D conversion
              • 1 MHz sample rate
              • 70 dB signal to noise ratio
              • 0 to 3.3 V or 0 to 5 V input range (select either AREF or IOREF via jumper J8 onboard)

              If it is required to use an ADC to work with +/-10VDC  you can try by adding an external ADC and connect it through SPI to the board, there isn’t an official document on how to do this but I encourage you to try it and to share your results.

               

              Kind regards,
              -Charlie

              1 of 1 people found this helpful