• 0

C++ for microprocessor chip


Question

After the holiday I'm attending a class on highschool called "Megatronic" where we are about to program C++ for a microprocessor. It will be able to control hardware we make ourselves.

I allready familiar with C++ but I don't have the slightest clue what the differences will be.

We will probably learn all this after the holiday but I'm too curious to wait:

What does the main loop look like?

- just int main(){ stuff? } or does it have to be a loop like while(1) ?

(those microprocessors constantly run an infinite loop as far as i know)

How can i access the flag states of the pins? (on/off)

What is the limitations for those microprocessors?

- Which datatypes can I use and are there some C++ "construct" that whon't work like swtiches for example?

How can i configure MSVC++ 6.0 to program theese small programs?

(so it doesn't compile for windows for example)

Link to comment
https://www.neowin.net/forum/topic/353610-c-for-microprocessor-chip/
Share on other sites

3 answers to this question

Recommended Posts

  • 0
  Andos said:
After the holiday I'm attending a class on highschool called "Megatronic" where we are about to program C++ for a microprocessor. It will be able to control hardware we make ourselves.

I allready familiar with C++ but I don't have the slightest clue what the differences will be.

We will probably learn all this after the holiday but I'm too curious to wait:

What does the main loop look like?

- just int main(){ stuff? } or does it have to be a loop like while(1) ?

(those microprocessors constantly run an infinite loop as far as i know)

How can i access the flag states of the pins? (on/off)

What is the limitations for those microprocessors?

- Which datatypes can I use and are there some C++ "construct" that whon't work like swtiches for example?

How can i configure MSVC++ 6.0 to program theese small programs?

(so it doesn't compile for windows for example)

586321428[/snapback]

Usually you use C/Assembly to access to hardware, but the basic idea is very similar to writing/reading off memory

We use this for most of the assembly programming here:

http://www-ug.eecg.utoronto.ca/gizmo/

and take a look at this lab about using C to access the system:

http://www-ug.eecg.utoronto.ca/gizmo/MLabs/labM13.pdf

  • 0

Unfortunately I think that confused me even more :blush:

Our teacher were quite specific that it would be c++ and not assembly. Maybe he has written some handy functions for easy pin access or something.

I don't know assembly programming at all, the papers you linked to made no real sense for me sorry.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.