MeMe90
Posts: 3
Joined: Mon May 30, 2016 6:04 pm

Programming without the Pi

Mon May 30, 2016 6:18 pm

Hi everyone,

I am new to Rarpberry Pi, I have just started reading about the subject a couple of days ago. I am planning to order a starter kit , but until the kit arrives, I wonder if I can start programming using some kind of simulator, I have previous knowledge in FPGA and Xilinx ISE , I used to write the code and see the results on the simulator then apply the design to the FPGA. Can I do the same thing with the Raspberry Pi ? I mean, can I write my code and watch my results on a simulator without having the kit? the thing is that I want to start as soon as possible

Thank you
Last edited by MeMe90 on Mon May 30, 2016 9:33 pm, edited 1 time in total.

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: Programming without the Pi

Mon May 30, 2016 8:11 pm

This is a fabulous idea... if it doesn't exist somewhere somebody's working on it!

... imagine an extension to Fritzing (maybe) that you might virtually wire-up to a GPIO simulator... and be able to run your RPi.GPIO or wiringpi code snippets on-line rather than physically wiring them on the desk.

... something similar to this.
marcus
:ugeek:

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Programming without the Pi

Tue May 31, 2016 7:16 am

there is a python simulator built into LearnPython.org
Doug.
Building Management Systems Engineer.

MeMe90
Posts: 3
Joined: Mon May 30, 2016 6:04 pm

Re: Programming without the Pi

Tue May 31, 2016 6:04 pm

hi,
Thank you for your replies
I am still new to this, Can I use C in this simulator ?
I am only familiar with C and Java, are there any simulators for these languages?

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Programming without the Pi

Tue May 31, 2016 7:17 pm

Java doesn't need a simulator since it's supposed to
be platform-independent , am i right ? :twisted:

Recent versions of QEMU can actually emulate the Raspberry Pi
instead of "Versatile PB". To get those you propably need
to build from source.

http://blog.3mdeb.com/2015/12/30/emulat ... 2-in-qemu/

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

MeMe90
Posts: 3
Joined: Mon May 30, 2016 6:04 pm

Re: Programming without the Pi

Wed Jun 01, 2016 2:10 pm

Does this emualtor work on Windows?

I need the simulator so I can check whether my GPIO are as expected or not and thing like that . Currently I don't have the Raspberry Pi . This is why I need the simulator so I can start learning ASAP. any suggestions on how to start using the raspberry pi without actually having it?

Thanks

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Programming without the Pi

Wed Jun 01, 2016 3:15 pm

You would be advised to think of the Pi like a Linux laptop
and not to treat the Pi like a simple microcontroller (which
it isn't) or like an FPGA.

If you try to program the Pi like a microcontroller or FPGA
you will end up fighting the operating system at every step.
You are dependent on the operating system and should
cooperate and use its facilities which make life easier.

You need to think like someone who writes PC software for
Windows or Linux.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

ejolson
Posts: 5477
Joined: Tue Mar 18, 2014 11:47 am

Re: Programming without the Pi

Wed Jun 01, 2016 6:44 pm

MeMe90 wrote:Does this emualtor work on Windows?

I need the simulator so I can check whether my GPIO are as expected or not and thing like that . Currently I don't have the Raspberry Pi . This is why I need the simulator so I can start learning ASAP. any suggestions on how to start using the raspberry pi without actually having it?

Thanks
The closest thing to a Raspberry Pi simulator is QEMU doing ARM emulation. Unfortunately, QEMU does not currently emulate GPIO or the VC4 GPU. The GPIO should be fairly easy to emulate as demonstrated by this QEMU emulator for the 486-based bifferboard. However, no one has done so, probably because the Raspberry Pi is already a full-featured self-hosting development system far cheaper than any emulator.

Since Raspbian is functionally almost the same as Debian Linux, a typical solution is to write C code on a Linux PC and link with a custom library that emulates the GPIO API that will be later used on the Pi. As far as I know, there is no general GPIO emulation library and developers typically implement only the functionality they need for their particular application.

A general GPIO emulation library might be an interesting project. Maybe dbus could be used to send the emulated GPIO signals to another program that emulates whatever hardware might be connected to the real GPIO on the Pi.

User avatar
MarkHaysHarris777
Posts: 1820
Joined: Mon Mar 23, 2015 7:39 am
Location: Rochester, MN
Contact: Website

Re: Programming without the Pi

Wed Jun 01, 2016 8:00 pm

ghans wrote:Java doesn't need a simulator since it's supposed to
be platform-independent , am i right ? :twisted:
Correct, you are ! ---compile once, debug everywhere :lol:
marcus
:ugeek:

Return to “Beginners”