user4rpi
Posts: 4
Joined: Mon Dec 15, 2014 5:49 pm

Can this dual RPi and Mac usage work?

Mon Dec 15, 2014 6:41 pm

I am new to the Raspberry Pi, and would like feedback to know if the following would work:

I would like to run 2 Raspberry Pi's (RPi's) along with my MacBook Air. I assume the Mac would be best for writing and compiling code. One "normal" RPi would run my high level C user program in the normal Debian environment so I could display info via HDMI display, get user input via keyboard / mouse, talk to the Mac when needed, and talk to the 2nd "userAsm" RPi. The userAsm RPi would run ONLY my own assembly code, with NOTHING else (including OS and interrupts) running, and it would be responsible for real-time control of stepper and servo motors, reading encoders & buttons and real-time clock, and controlling misc. hardware and breakout boards all through the GPIO bits.

This would isolate all high speed real time code to the userAsm RPi which would run only my assembly code in a very high frequency polled state machine architecture, using a high frequency resolution real-time clock (hardware added as needed).

The normal RPi would get input from the user and display information, and talk as needed to the userAsm RPi and the Mac. It would use the normal OS and would be subject to normal latencies and interruptions.

Does all this sound reasonable? Being new to the RPi, I really need the feedback before diving into this kind of project. As a bit of background, I have been an arcade and console game programmer my whole career and am used to doing projects in this type of manner.

Thanks for your comments.

drgeoff
Posts: 10765
Joined: Wed Jan 25, 2012 6:39 pm

Re: Can this dual RPi and Mac usage work?

Mon Dec 15, 2014 7:57 pm

Suggest you read lots of posts in the "Bare metal" part of the forum. (It's under the "Programming" heading".)

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Can this dual RPi and Mac usage work?

Mon Dec 15, 2014 8:00 pm

For the real-time stuff you may be better off with an Arduino. (Or a Gertduino or Arduberry sitting atop your Raspberry Pi.)
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

user4rpi
Posts: 4
Joined: Mon Dec 15, 2014 5:49 pm

Re: Can this dual RPi and Mac usage work?

Mon Dec 15, 2014 9:06 pm

Thanks for your reply.

I looked up the Gertduino. It seems to be an 8 bit integer processor at 16 Mhz. The Raspberry Pi is a 32 bit integer and vector floating point processor at 700 Mhz. This is a night and day difference. The RPi doesn't have a realtime clock, but I'm assuming one can be found and accessed quickly via GPIO bits. This difference is so vast that I don't want to give up the chance to run assembly on the RPi, as I intend to use these better and drastically faster instructions to make the high speed polling work. What I'm after is 100% rock solid real time response without possibility of hiccups from interrupts and OS software.

The Arduberry would allow access to other Arduino boards, which is interesting, and might be useful in the case of using the 2nd RPi as I am hoping to, but doesn't seem to help if trying to replace the 2nd RPi, since there is no other processor in the same league as the RPi.

What I'm interested in is what would stop what I want to do from working? Is there some fatal problem shutting off the OS and interrupts in the 2nd RPi that can't be overcome? Is it impossible to debug in that kind of mode? Even if so, could assembly code be loaded to the 2nd RPi and just run, assuming that the assembly code was written so carefully that it could get past not having debugging ability? I'm willing to use GPIO pins between the two RPi's with software handshaking to get them to communicate modest amounts of data without using other hardware if need be.

user4rpi
Posts: 4
Joined: Mon Dec 15, 2014 5:49 pm

Re: Can this dual RPi and Mac usage work?

Mon Dec 15, 2014 9:10 pm

I'll take at look at the bare metal posts. Thanks for the suggestion.
Do you think I should re-post it there, if it would be more a appropriate spot?

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

Re: Can this dual RPi and Mac usage work?

Tue Dec 16, 2014 10:51 am

Yes , that would be a good idea.

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

Return to “Beginners”