Can a solution consist of 1 to many projects?

Go To Last Post
22 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Questions:

1-Can a solution consist of 1 to many projects?

2-In your example ,the name of the projects imply any meaning?

3- How do we determine "Dependency" in a project?

4-Is libraries consist of .h files or .c &.h files?

5- What do you mean by sorce files ?do you mean only "main.c" files or any .c file?

6-In compiling and building ,should there be a main.c file, or any .c file can be used?

7-You mentioned "project directories",which folder or files do you mean? 

8- In a multi project solution,which project is considered to be the main one? How are they used or linked together?

9- Why while each project works ok on its own,but when linked or added together,there is errors?

Last Edited: Tue. May 19, 2020 - 10:15 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The Uk eh?  I used to converse a great deal with a guy over there that I met on another electronics website.  He used to try and explain "UK things" to me, and I'd try to help him with his electronics (and explain a few 'US things, like "grilling" and ""BBQing" are not the same thing).   He was a really great guy, I miss him (he died suddenly for some reason I do not know).

 

So, we're doing the "caravan" thing.  We plan on doing this full time somewhat soon (pushed back because of the stock market crunch).  And microcontrollers and programming will be one of my hobbies to keep my worn out old brain from getting buggy in the RV.  I planned on doing more simulation than real hardware, but now it's looking to be more hardware.  So I'm trying to get all my hardware projects lined up as much as possible so I don't have to take all my goodies (Just not enough room!)

 

Yes, I had a boatload of gold plated .025" square pins I put on those outside rows.  Nice pins, long, so square posts on the bottom, and round pins on top so I can go either way with those, and I did put female headers on the Arduino headers on top, so I can plug a shield into those, and the whole shebang into my main board.

 

I never went the Arduino route, but I'll have to look at the few of those shields.  I picked up an Uno and a few of those Uno mini's from All Electronics (and I got an ICE from MC, yay).  So, no matter what, I'm in Atmel now smiley  I wish I would have started several years ago like I had planned, but I kept giving PIC the old college try because I was so invested in it.   (I like the Zilog stuff because I "grew up" on the Z80 and most of their commands are pretty familiar.  But from looking at their website, I'm not sure how much longer they'll be doing anything I can use, like no support)

 

Can't wait to look at your code, I can look at this weekend, but can't try anything until later.  Thanks again!

Just gettin' started, again....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's a bit of a random reply - methinks some finger trouble.

 

BTW, Atmel is Microchip! Something to do with acquisitions or something.....

If you're coming from PICs, why AVR in this day and age??

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is an old-school way of doing things with Makefiles that may help when doing a multi-project approach. Unfortunately, if you are relying on the IDE this will not help.

 

https://github.com/epccs/Gravimetric/blob/master/Applications/i2c1-debug/Makefile

 

The GNU make facility is used for this. I run it on a Linux instance where it works as it was designed to. However, as much as I like this method it is not what Microchip and AS7 support if you are doing things that someone is paying you to do then you probably need to use the supported tools in a way that they are designed to work. So maybe don't do multi-projects.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note that Atmel Studio is built on Microsoft Visual Studio - so most questions about general use, Project setup, etc, can be also answered from the MS documentation, or including "Visual Studio" in your Google search terms

 

You are asking some very basic questions here.

 

Here are some 'C' learning & reference materials for you:

 

http://blog.antronics.co.uk/2011/08/08/so-youre-thinking-of-starting-with-c/

 

Again, there is a set of introductory videos on the Atmel Studio page:

 

https://www.microchip.com/mplab/avr-support/atmel-studio-7

 

You really should take the time to study them before just asking questions that are covered in basic documentation.

 

Getting started guides:

 

https://www.google.com/search?q=atmel+studio+getting+started

 

http://atmel-studio-doc.s3-website-us-east-1.amazonaws.com/webhelp/GUID-54E8AE06-C4C4-430C-B316-1C19714D122B-en-US-1/index.html?GUID-8F63ECC8-08B9-4CCD-85EF-88D30AC06499

 

http://ww1.microchip.com/downloads/en/DeviceDoc/Getting-Started-with-Atmel-Studio7.pdf

 

Atmel Studio User Guide:

 

http://ww1.microchip.com/downloads/en/devicedoc/atmel-42167-atmel-studio_user%20guide.pdf

 

The online Atmel Studio documentation is here:

 

https://onlinedocs.microchip.com/pr/GUID-ECD8A826-B1DA-44FC-BE0B-5A53418A47BD-en-US-4.1.1/index.html?GUID-00257F02-E33C-40C3-B324-83DBCC05EC30

 

 

 

azizollah wrote:
1-Can a solution consist of 1 to many projects?

Yes

 

2-In your example ,the name of the projects imply any meaning?

No.

 

Like file names, etc, they are purely to help the human reader think about what the project is

 

3- How do we determine "Dependency" in a project?

This is determined by the build process

 

4-Is libraries consist of .h files or .c &.h files?

This has nothing specifically to do with Atmel Studio - this is standard programming stuff.

 

https://en.wikipedia.org/wiki/Library_(computing)

 

Traditionally, a "library" meant something pre-built and delivered in binary form.

You would need a header to go with it to allow your own source code to know what functions are available, and how to call them.

You would include the binary image in your link.

 

Nowadays, "library" is often used to mean a set of source files - so that would have to be both .c and .h

 

But, in both cases, .h files are required, but they are not the library - they simply describe the interface.

 

If you just #include the .h file(s) - without also having the binary or source in your project - you will get "Undefined Reference" errors when linking.

This is a common mistake.

 

 

5- What do you mean by sorce files ?do you mean only "main.c" files or any .c file?

* source

 

This is basic programming stuff: not specific to Atmel Studio - or even to 'C'

 

https://en.wikipedia.org/wiki/Source_code

 

Source files are the human-readable input that you write, and the compiler/assembler translate.

 

 

 

6-In compiling and building ,should there be a main.c file, or any .c file can be used?

See above - there is no significance to the file names.

 

The 'C' programming language does require that you have a function called main() as its starting point - but the name of the file which contains it is immaterial.

 

Although it's not uncommon to call the file which contains the main() function "main.c", it is by no means required to call it that.

 

7-You mentioned "project directories",which folder or files do you mean? 

The ones which contain all the stuff which makes up the Project!

 

Usually, "The Project folder" (ie, with the definite article) is used to mean the highest-level folder under which all other Project stuff resides; the top level of the Project structure; its "root".

 

An important thing to understand is that the structure shown within Atmel/Visual Studio in its 'Project Explorer' window does not necessarily correspond to the folder structure on your hard drive.

 

8- In a multi project solution,which project is considered to be the main one? How are they used or linked together?

In Atmel Studio, it is highlighted in Bold.

 

Atmel Studio (inheriting from Visual Studio) calls this the Startup Project.

 

9- Why while each project works ok on its own,but when linked or added together,there is errors?

Projects aren't usually intended to be just linked together.

 

Usually, you use separate Project to describe different "products" - they build independently.

 

 

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. May 20, 2020 - 08:41 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

To understand the build process, and how all the various tools - Compiler, Assembler, Linker, etc - are involved, take a look at this thread:

 

https://www.avrfreaks.net/forum/avr-gcc-compiling-linking-and-assembly

 

In particular, the diagrams in these posts:

 

https://www.avrfreaks.net/commen...

 

https://www.avrfreaks.net/commen...

 

For example:

 

 

Again, this is standard stuff - nothing specifically to do with Atmel Studio or AVR or Atmel/Microchip.

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. May 20, 2020 - 08:16 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
That's a bit of a random reply

#1 here was originally a hijack in this thread:

 

https://www.avrfreaks.net/forum/...

 

That reply belongs in the original thread.

 

(I gather that picking specific post to move is not a trivial task with this forum)

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you Awneil for your answers and the links,

I will have a look at them.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You're welcome. They will keep you busy for a while!

 

laugh

 

The important thing with learning any new skill is to start with the basics and lay firm foundations before moving on to more advanced topics.

 

It seems you are trying to jump in over your head to something over complicated - and struggling because you don't have those solid, basic foundations.

 

I would suggest that you take a few steps back, and start with the basics - something much simpler.

 

See Tip #6.

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

BTW, Atmel is Microchip! Something to do with acquisitions or something.....

If you're coming from PICs, why AVR in this day and age??

 

 

Yeah, I know MC bought Atmel, I didn't know it until fairly recently though.  MC is normally a pretty good company, it's not like I hate MC, I almost bought some of their stock a little while ago, so I have faith in them as a company and a product supplier, tech support (for MC only it looks) is pretty good, I'm not sure anybody even works on Zilog's website any more.

 

Lets just say I'm not happy with mc right now. I'm not buying yet another ICD, just tired of everything being obsoleted.

 

The plan all along was to finish what I started with PICs, then move  on to Atmel and then Zilog.  I "grew up" on Zilog, so that's why them, I'm already mostly familiar with their assembly commands.

So I'm boxing everything up that has to do with MC, I may toss it or keep it, not sure yet.

 

Atmel seemed to be more straight forward.  The Harvard architecture takes a bit of getting used to, but that'a mostly all microcontrollers.

 

I've got several of those old SP0256's (which ironically, I believe were made by the predecessor to MC, GI, one of their first "PICs" before it was a PIC).  That's one of my projects for when we start the RV full time.   I got them talking a long time ago, but never could get all the words quite right, got to fix that.

Just gettin' started, again....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

azizollah wrote:

Thank you Awneil for your answers and the links,

I will have a look at them.

 

The videos from MC/Atmel on getting started (both, for Studio 7 and the Atmel chips) are pretty good, I wish they would slow down a bit though.

 

But I would also suggest a few different sources.  I have several books on C, C++ and reference manuals, a couple tutorials on my phone etc....  I find that by going through all of them at the same time, or cross referencing a subject, one may explain something better than another.   For instance, when I was reading about Pointer's in one book, it was a very confusing read, but another source (or two) was much less confusing.   There's plenty of material out there, don't limit yourself.

Just gettin' started, again....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OldMicroGuy wrote:
I wish they would slow down a bit though

at least you can pause & replay them!

 

But I would also suggest a few different sources.  I have several books on C, C++ and reference manuals, a couple tutorials on my phone etc....  I find that by going through all of them at the same time, or cross referencing a subject, one may explain something better than another.   For instance, when I was reading about Pointer's in one book, it was a very confusing read, but another source (or two) was much less confusing.   There's plenty of material out there, don't limit yourself.

Very good point.

 

Especially as a lot of this stuff is not specific to Atmel Studio - it is general programming.

 

When it comes to learning the 'C' programming language, the common recommendation is not to try to do that on a (small) microcontroller - do it on a PC (or similar) instead.

 

In a recent tutorial, Kartman wrote:
Ask yourself “how many problems do I want to solve at once”? The answer should be one. Trying to solve more than one problem at a time is a recipe for failure.

 

https://www.avrfreaks.net/forum/help-it-doesnt-work  

 

Learning the  'C' programming language is quite enough as your one problem to solve - you do not want to also be adding all the complications & restrictions of a small microcontroller!

 

There are plenty of free 'C' development environments available on PCs, and they give a far more "comfortable" learning experience.

 

As already noted, Atmel Studio is built on MS Visual Studio; a free edition is available, so that would seem like an obvious choice if using Atmel Studio is the final goal ...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. May 20, 2020 - 01:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OldMicroGuy wrote:
MC is normally a pretty good company, ...
Partially due to competition; Microchip is competing against, IIRC #1 by volume, Renesas.

OldMicroGuy wrote:
I'm not sure anybody even works on Zilog's website any more.
fyi, Zilog was acquired.

Littelfuse To Acquire Ixys Corporation - Littelfuse

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

OldMicroGuy wrote:
I wish they would slow down a bit though

at least you can pause & replay them!

 

 

Oh I do!  "Wait!  What was that?  What'd he click on?  Where did THAT come from!  How come *I* don't have that option!?  Whoa!....."

 

Oh yeah.   It's hard to watch the video on one machine and do the same on another at the same time, my old brain isn't as nimble as "spongy" as it used to be.sad

Just gettin' started, again....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:

 

OldMicroGuy wrote:
I'm not sure anybody even works on Zilog's website any more.
fyi, Zilog was acquired.

Littelfuse To Acquire Ixys Corporation - Littelfuse

 

 

Yes, I saw that.  Not sure who's doing what though, or what their future holds.  Their website still has a lot of flash based content, and that's no longer going to be supported by at least chrome.  I've inquired about it (because I can't get to some files), and no response, and nothing much on the Ixys/Littlefuse site either.  They transferred some content over there, but still not getting to what I wanted.

 

 

Just gettin' started, again....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OldMicroGuy wrote:
 It's hard to watch the video on one machine and do the same on another quote]

So why not have them both on the same machine ?!

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yikes. This thread has derailed itself again. This post really belongs in the pother thread, but hey-ho.

 

OldMicroGuy wrote:
The Harvard architecture takes a bit of getting used to,

Eh!

PIC12, PIC16, PIC18 & PIC24 are all Harvard. (PIC24 modified Harvard; in that there is a small amount of flash mapped to SRAM area)

 

Which PIC were you using that you hated so much. I did some PIC16 work in ASM a long time ago, it's OK, you just have to think differently.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The same machine would be even harder, having to switch and close one down.  They were on two screens, close by, just not as nimble as I used to be.  It's like trying to read two books at the same time.'F628 

 

I was using mostly the 'f628 and 877 (I have a whole bunch of 'em).   It's just different than von neuman, like the z80.  I never did fully get the bank switching I got most of it, but not all.  The PICs were just part of the issue.  The Snap, supposedly does ICSP, but only for select chips.  So, ICSP isn't the same across the board?  The way I look at it, if it does one chip, then it ought to do all of them that support ICSP.  I know the problem was somebody just didn't Ok the Snap to program a particular part by testing it.   But come on, ICSP should be ICSP.   So it didn't do squat for me, and the PICKit4, was "blowing up" (SCR latchup I suppose) their own parts, "Oh yeah, you have to modify that to program older chips...."  I'm done with 'em.   There's more to it, but I'm just tired of trying to deal with them.

Just gettin' started, again....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OldMicroGuy wrote:
The same machine would be even harder, having to switch and close one down.

Eh?!

 

You don't have to close down and switch!

 

Have them side-by-side at the same time!

 

See: https://www.avrfreaks.net/forum/...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OldMicroGuy wrote:
The Snap, supposedly does ICSP, but only for select chips.
MPLAB Snap support was PIC centric for quite sometime until recently (MPLAB X v5.40)

MPLAB X IDE | Microchip Technology

MPLAB Snap

OldMicroGuy wrote:
... and the PICKit4, was "blowing up" (SCR latchup I suppose) their own parts, ...
ETN #37 MPLAB® PICkit 4 VPP Overshoot Modification

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

azizollah wrote:

1-Can a solution consist of 1 to many projects?

 

awneil wrote:
Yes

In fact, a Solution can be empty; ie, it can have no Projects!

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

OldMicroGuy wrote:
The same machine would be even harder, having to switch and close one down.

Eh?!

 

You don't have to close down and switch!

 

Have them side-by-side at the same time!

 

See: https://www.avrfreaks.net/forum/...

 

 

Most of reading is currently in the lazy man chair in the living room, in front of the big screen.   So yeah, I'm considering that.  I need to get everything talking nicely to each other.  But yep, I'm right there with ya.  That post may help me out in that respect.

 

The only problem is later, my fiance' will complain about not being able to watch Alaskan Bush People or something.

 

Right now, she's working from home, so my dearly departed fathers room is acting office.  If she goes back to work (this may last until she retires), then I'm taking over the office and the big screen that's up there for sure.

 

Thanks for that post, it may help do what I planned!!

Just gettin' started, again....