I am trying to use a program that has been written for STM32 microprocessor for interfacing with a Time to Digital Converter TDC GP22 via SPI interface. I would like to use the same program and adapt it to suit Arduino Uno for interfacing with TDC GP22. This would really help save a lot of time.

Can someone please suggest me the most effective way to do this ?

  • 3
    Read the code. Write high-level pseudocode. Translate the pseudocode. Aug 7 '14 at 1:41
  • @user18197 - Do you know how to use programming languages other than the Arduino's? Specifically, do you know languages that are good at text processing using regular expressions? For example, Perl, Python, Rubu, Go, awk, etc?
    – gbulmer
    Aug 7 '14 at 15:01

You'll be wasting your time tring to convert the code on a procedure by procedure basis. Arduino has different libraries, different clocks, different pins, etc.

I suggest you flowchart the code, and then work out which of the Arduino libraries (SPI, LCD, etc.) you can use to achieve the flow. You'll be able to drop some of the initialisation code probably as Arduino is easier to run "out the box".

There's no quick-and-easy solution here - it's a re-write... as you'll find is often the case migrating code from one MCU to another.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.