Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Could I program a non arduino MCU with Arduino software?

Author
Message
Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 8th Apr 2012 08:04
Hello all! I was just curious, for my console (which is currently legitimately being developed unlike before) i will being using microcontrollers (MCU's) for audio and graphics. I originally didnt want to mess around with some C++ compiler to program the chips, so i thought assembly would work nicely. However, judging by examples i have seen, i quite like the Arduino language and compiler and i was wondering if a microcontroller NOT on an Arduino board could be programmed with that software. I assume it would require a USB communication of sorts. Thank you for any answers you may post!

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Apr 2012 11:04
Arduino is from what I've seen C++, right? All you need is a compiler capable of compiling to the specific MPU's instruction set. What MCU are you using?

At work I use MPLab. Here's a thread discussing how to set up C++ : http://www.microchip.com/forums/m559302.aspx

TheComet

MrValentine
AGK Backer
14
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 8th Apr 2012 13:37
you two drive my brain cells up the wall >.<

NIlooc223
14
Years of Service
User Offline
Joined: 27th Aug 2010
Location: Heaven
Posted: 8th Apr 2012 18:33
Me at first then I was like and then finally

None of above made since to me...

Your signature has been erased by a mod - no affiliate links thanks
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Apr 2012 18:52
@ MrValentine & NIlooc223

Years of MineCraft, ponies, and Kit Kat Chunkies.


@ DBD79

Forgot to mention, I find the best way to communicate with the MCU is via the JTAG adapter.

Here's a wikipedia link : http://en.wikipedia.org/wiki/Joint_Test_Action_Group

And here's the pinout (Sorry, German) : http://www.mikrocontroller.net/articles/JTAG

There are adapters that interface with the JTAG. I use a USB adapter, but I'm not sure what it's called now. If you want I can look into it next Tuesday if that's the direction you want to go.

TheComet

AbdulAhad
15
Years of Service
User Offline
Joined: 1st Feb 2010
Location: Karachi, Pakistan
Posted: 8th Apr 2012 19:05
An Arduino can be programmed in Java, C or C++, if I'm not mistaken. I've used the Proto Shield kit for making a very famous, Makey the robot, pretty easy to put together!

Quote: "Arduino is from what I've seen C++, right? All you need is a compiler capable of compiling to the specific MPU's instruction set."


But yeah this is pretty much what you need!

Abdul Ahad

Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 8th Apr 2012 23:56
Hey Comet, iil take a gander at those links in a tad!

Quote: "you two drive my brain cells up the wall"


Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 9th Apr 2012 00:47 Edited at: 9th Apr 2012 00:48
Just do it in assembly..

Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 9th Apr 2012 06:10
Yah, seems like that would be better for the brain.

Randomness 128
18
Years of Service
User Offline
Joined: 13th Feb 2007
Location:
Posted: 9th Apr 2012 06:16
I'm making a game in assembly, and my brain is perfectly rydsddsce levitating potatoes of fire.
Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 9th Apr 2012 06:48
[i][/i]

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Apr 2012 15:58
But that's going to be hell for you if you program that in assembly. It's impractical for more complex applications, and I believe your console falls into the category of "more complex application".

MPLab supports C right out of the box. Just use that.

TheComet

Dextro
20
Years of Service
User Offline
Joined: 26th Feb 2005
Location:
Posted: 9th Apr 2012 18:29 Edited at: 9th Apr 2012 18:33
Use assembly. Microcontrollers are not as fast as people make them out to be, and unless you are using an ARM, speed is going to be a major issue given the tight control you need to generate the video signal.
MCU's are not designed for this kind of applications, thus the need to squeeze every bit of perfomance you can get out of them.
Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 9th Apr 2012 21:29
Ideally, when if its performance critical, then yeah you should use assembly. But, if it's your first foray into this style of programming, then forget it. Get it working first in some high level language, optimize your methods, then port it down once it happy.

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Apr 2012 21:36
Quote: "Use assembly. Microcontrollers are not as fast as people make them out to be, and unless you are using an ARM, speed is going to be a major issue given the tight control you need to generate the video signal.
MCU's are not designed for this kind of applications, thus the need to squeeze every bit of perfomance you can get out of them. "


Have you ever programmed one in assembler before? I think you're forgetting how damn hard that really is in comparison to C. Besides, C compilers are highly efficient today, and you can tweak the disassembled code if you really have to after compilation.

@ DBD79 - What MCUs are you using? It would really help if you told me.

TheComet

Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 10th Apr 2012 01:23 Edited at: 10th Apr 2012 02:32
Quote: "What MCUs are you using? "
I'm not sure as of now... Honestly, what would you recommend for video and sound? I'm assuming I'll need a significantly faster one fore video. I'll list my preferred sound and video specs below so you know what I'm talking about:

Sound:
1 PCM channel
1 square wave channel
1 sine wave channel
1 noise channel

Video:
Standard composite video aspect ratio
At least 30 FPS
2D graphics only

Also, I was wondering if there are any good USB IC's in existence or if I need a micro controller there as well. I'm looking for an IC that would have a USB input on one side that connects to a computer, and a simple data buffer on the other side that is accessible by the processor.. Thanks!

Also, mentioned above was the fact that i may need very tight control to generate a video signal. Though i hope to use the MCU's analog output as the video output, if need be i can simply have it write image data to a buffer where other circuitry can then render it into a video signal.

Dextro
20
Years of Service
User Offline
Joined: 26th Feb 2005
Location:
Posted: 13th Apr 2012 19:16 Edited at: 13th Apr 2012 19:29
Quote: "Have you ever programmed one in assembler before? I think you're forgetting how damn hard that really is in comparison to C. Besides, C compilers are highly efficient today, and you can tweak the disassembled code if you really have to after compilation."

Actually, I find assembler to be easier than C. But to be fair, I have never programmed an Arduino in assembler.
I have dabbled with Microchip PIC's, and found assembler to be way "easier" and faster than C.
High level languages tend to be more abstract, while assembler like languages are more concrete, thus the perception of ease.
Edit:
Also, you should account for the processor's architecture. CISC like processors are a bit easier to program in assembler than RISC based.
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 13th Apr 2012 19:26 Edited at: 13th Apr 2012 19:26
I have heard that C is often faster than hand-written assembly

http://stackoverflow.com/questions/577554/when-is-assembler-faster-than-c

Quote: "Many years ago I was teaching someone to program in C. The exercise was to rotate a graphic through 90 degrees. He came back with a solution that took several minutes to complete, mainly because he was using multiplies and divides etc. I showed him how to recast the problem using bit shifts, and the time to process came down to about 30 seconds on the non-optimizing compiler he had. I had just got an optimizing compiler and same code rotated the graphic in < 5 seconds. I looked at the assembly code that the compiler was generating, and from what I saw decided there and then that my days writing assembler were over."


Dextro
20
Years of Service
User Offline
Joined: 26th Feb 2005
Location:
Posted: 13th Apr 2012 19:30 Edited at: 13th Apr 2012 19:35
Well, I'm certainly not arguing that
As Kevin said, if it's not speed dependant, use C.
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 13th Apr 2012 19:34
Per Ardua ad Astra........oh wait, sorry, completely misread that title........

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 13th Apr 2012 20:43
Quote: "I have dabbled with Microchip PIC's, and found assembler to be way "easier" and faster than C."


It depends what you're doing. As I stated earlier, if it's something simple, you could do it in assembler. If it's something hard (like a game console), do it in C.

Things get nasty when you try to make 32 bit variables using only an 8 bit micro controller, especially when you're trying to do divisions with a RISC instruction set (which doesn't even have that operation).

Quote: "Honestly, what would you recommend for video and sound?"


I have no idea You need to find something that fits your demands. The websites you buy them from always have filters you can set.

TheComet

Kevin Picone
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 14th Apr 2012 02:29 Edited at: 14th Apr 2012 02:30
Quote: "I have heard that C is often faster than hand-written assembly"


There's too many unknowns in such generalizations to be of any real value. Primarily, the maturity of the compiler/assemblers for one and ultimately the quality of programmers can make a huge difference, on both sides of the fence.

Dextro
20
Years of Service
User Offline
Joined: 26th Feb 2005
Location:
Posted: 15th Apr 2012 11:29
Quote: "It depends what you're doing. As I stated earlier, if it's something simple, you could do it in assembler. If it's something hard (like a game console), do it in C."


The way I see it, the more control you need on performance, the more likely you'll have to use assembler. (again, I cite video signal generation, in which you REALLY need to count the cpu cycles).
I mean, if you're using complex systems like a PC, there's no point in using assembler. But for MCU's, the story is quite different when used outside of it's "targeted" scope (like using an arduino for a console).
Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 17th Apr 2012 07:16
Makes sense enough!... Ina ll reality, i dont want the console to be too easy or too quick to create. And to say that i programmed the video graphics processor code in assembly would be quite awesome. Also, when i create the OS, ill be doing so in assembly until i get the OS to where it can support programs, at which point ill write a compiler in assembly and finish the OS with the compiler from there.

Login to post a reply

Server time is: 2025-05-19 08:56:51
Your offset time is: 2025-05-19 08:56:51