Can't find ina90.h error, when compiling AVR TWI LCD project

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

I hope somebody can help me with this.  I need a LCD interface to move forward, and every time I try something, everything goes wrong.  It's "simple", if you already know what's going on.  When I try something, it's always a ton of errors or more and more files are needed.   I downloaded the TWI LCD Interface app note AVR 155.  Yeah, written 13 or so years ago.

I think I finally got it narrowed down to just a few errors and many warnings.  One of which is "can not find -lina90.h" (which is really ina90.h, took me a while but....frown)

I don't know who's asking for it or why.  I added the file, full path in every conceivable file (one after the other, not all at the same time), but it still will not clear the error.   Something wants that file, and I'll be danged if I can tell it where it is.

 

It's a long story getting here, worked (or tried to) with PIC controllers for a long time on and off, but had to just give up after the last straw.  Spent a lot of time and money on them and extras, but just not going to work out.  I had an LCD working on an old PIC project, but they're dead in the water now, i'm not going back angry.  I just want to kinda pick up there so I can move forward learning AVR's, but an LCD interface would make it so much easier.  And I don't want to reinvent the wheel, again.

 

I've seen posts here suggesting other libraries (and no, I never went the Arduino route).  But as I said, when I try other libraries, it's just more headaches and errors etc....  I'd like to just go with this Atmel app note as at least I have some documentation for it.

 

Eventually, I'd like to have it working with the popular 2wire interface LCD's you can get for couple bucks now.  But just compiling error free is a start.  

 

Thanks ahead of time.

Just gettin' started, again....

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

From the app note:

The code is written in C divided into two files, TWI_driver.c and LCD_control.c. Both files have
separate header files and are written for IAR C-compiler Version 1.50C/WIN. They are written in
ANSI C and it should be simple to change them for other compilers. I/O and linker files are
included in the code package added to the application note.

So, are you using this specific compiler?

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

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

I'm using what came with Studio 7.  I'm changing a lot of stuff in the code, but I can't see where this error is coming from.  There's no "include" for this file anywhere, telling the compiler where is, by adding it specifically (with full path) doesn't help.  All I get is an error, with no clue.

 

I know it's kinda stupid on my part, but I'm guessing a (set of ) files from Atmel, done for their microcontroller, published by them, that worked at one time (I guess), should work again with minimal changes, if it was done in ANSI C.

Just gettin' started, again....

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

Well, if I modify that line about the "flash" string (mentioned in the other post on storing something in flash memory), sometimes the error doesn't show up (won't compile either).   So I'm guessing the compiler is trying to pull something in based on the functions it sees.  If I can get the flash memory string part figured out, that error may go away.   So far, it doesn't seem to like anything I do with that string.

Just gettin' started, again....

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

Isnt ina90.h an IAR header?

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

I believe the program was compiled for IAR.    Apparently the code has to be updated, and I'm not having much luck, I know just enough C to get in trouble.   I've spent a lot more time on assembly and trying to use PIC.

Just gettin' started, again....

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

What happens if you create a dummy ina90.h file and then look to see what functions, variables, and macros are not declared when you try to compile the program.

 

I have done that for projects handed to me where the original compiler was long gone and some of the source files were AWOL.

 

With some effort, I was able to see what SPECIFICALLY was missing and could figure out what was needed to compile the project with new(er) tools.

 

Edit: What compiler are you using?

If Atmel Studio, what are the errors that show up in the output tab?

David

Last Edited: Sat. May 16, 2020 - 07:06 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The AVR-LibC that supports avr-gcc does have this guidance about porting IAR to GCC...

 

https://www.nongnu.org/avr-libc/...

 

But if what you are trying to achieve is HD44780 over I2C then why bother with some ancient old app note for the wrong compiler when you'll find 50 examples specifically for avr-gcc dotted around the web?

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

The AVR155.zip on the Microchip website is dated 2004.   And was written for the ATmega163.

 

It is not a HD44780 driver but a COG (chip on glass) controller with native I2C interface.

 

Please post a link to the actual display that you have bought e,g. Ebay Sale page

And which AVR board or AVR chip you are using.

 

It is relatively easy to port the AVR155 App Note code to an AS7.0 project.   I have it building for GCC and for Codevision.   Untested because I don't have the COG hardware.

 

David.

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

Frog_jr:     I have a ina90.h file on my laptop, but I can't get the compiler to see it.  None of the files had it included.  And if I added the full path in a file, it still wouldn't use it, this was the compiler only complaining about it.

My guess is, it is an automatic include based on what the compiler sees, sort of like including the iom628ph. 

And the error message is, it can't find that file.  That's it.  I had a heck of a time trying to figure out what was going on, the only reference to it (even a search on google turned up little) was in the make file.  And since I'm not allowed to edit that (output), I can't give it a path.   That's what got me here, there was just no clue what was going on.

 

I'm using studio 7 with the latest installs.  I'm just trying to get back into this, so everything was just downloaded and installed.

 

Clawson:   Because I have tried to download those files, that are supposed to be working and simple to use.  And nothing works.  I gave up.  I got one from davidegironi, the readme file touts how easy it is to use.  But I have no clue what a fluerypath is.  (yet) another file I need?  Plus, a lot more errors than I cared to count    I'm guessing it was Arduino based, and I never went there.

People write this stuff, knowing how it works, so it's simple to them.  I looked at that guys website, and there were tons to messages from people trying to get it to work.  I found that I had to keep hunting and downloading and installing more stuff.

 

I mentioned before, I wasted a lot of time and effort on PICs, and I'm just kinda trying to pick up where I left off.  But I really would like a working LCD so I can output to that.  I had an LCD working on PIC, but I'm not even talking about that right now I'm still so aggravated with them.    So I'm trying to move forward, but keep hitting roadblock after roadblock.   Just trying to not reinvent the wheel, again.

 

Dave:   Thanks for that bit of information, I (wrongly) assumed that it was just standard 44780.  That was the next step, hunting down something that would help me port it to something newer.

I planned on using the bog standard pcf8575 2wire interface board you can get.  I got some off Amazon, and had some from All electronics that I didn't even know I had, all the same thing. 

https://www.allelectronics.com/item/lcd-si/serial-interface-module-for-16-x-2-lcds/1.html

 

As for the controller board, I'd start with the AtMega628P Xplained Xmini, and then also use it on some boards of my own design using the same chip and move on from there.   As for specific LCD's, I have a ton of them, COG, 2 =x16, 4x16, 4x40, graphics etc... most are the 44780 or compatible controller, a few oddballs.

I did order a few of these, so I have even more LCDs (they have backlights, so smiley)   https://www.amazon.com/gp/product/B019K5X53O/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1

 

Thanks all...

Just gettin' started, again....

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

There are several ways to organise an AS7.0 project.

 

The simplest way is to "Add" every C and H file to your Project e.g. Project->Add-> Existing_Item

This makes a fresh copy of the selected files.

 

I ADVISE ALL AS7.0 PROJECTS to put F_CPU in Project Properties

 

AS7.0 will compile all the C, CPP, S files.   It will find all the H files because they are in the Project directory

 

The alternative (for large projects) for Existing_Items is to "Add as Link"

And only store your specific "project.c" files in the project directory.

This means that you must tell AS7.0 which directories to search when it looks for H files.

Add these directories to your Project->Properties

Add any pre-compiled object libraries to Project->Properties

 

I have attached an AS7.0 Solution which contains 4 Projects.   Please try the OldMicroGuy_16x2 project first.   Your Amazon links "look like PCF8574 with address 0x27".   Edit lcd_config.h if otherwise.

 

I suggest that you solder regular Arduino headers to your XMINI-328P board.

This will let you mount Arduino Shields and run Arduino programs.

 

Incidentally,   I posted an AS7.0 solution for Azizollah recently  in this message.   And this contains the "Davide Gironi" project that should run on your 328P (aziz_uno).

 

David.

 

@Azizollah,

 

Please look at this AS7.0 solution.   You will need to edit projects for your Mega32A, F_CPU and possibly your PCF8574 backpack address.

But it should show you that copying all your files into one project directory makes life easier.

Attachment(s): 

Last Edited: Mon. May 18, 2020 - 02:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you very much kind sir.  I'll take a look at them and get back to you.  Right now, we're fixing to head out for a long weekend, so I'm not sure when I'll be able to actually work with the files, some time late next week maybe, maybe later.

I think, no matter what, I need to go back to the old assembly route with a 4(6) pin interface, on both the Atmel and Zilog parts (I'm learning both, was all three in you include the PIC), and sort of work a parallel C solution on both at the same time.  But this will help tremendously with that.

I did solder a bunch of pins that I have on that Xplained board.  I don't know why they offset one of of those headers by .05", what a bonehead move.  I used the outer rows so everything is on .1" centers, can't plug in a regular Arduino shield, but no problems as I don't plan on it.  I made a board that accepts several (including this one) controller boards, and breaks out almost everything.  So, one board, Atmel, Zilog, PIC (if I ever go back....).  (of course I have to make the controller boards, the Xplained just plugs right in)

 

The odd thing about the original issue (can't find that file), is I put links to it, I put it in the project directory, and it still wouldn't find it.   And  dearth of info on the error just left me clueless.   I'll take your advice to heart about the file locations too.

 

I've worked with engineers almost all of my adult life, in R&D (I mostly make prototypes, one off's, get them to market),  And one thing I know is most people that write stuff, do it from their viewpoint.  And that is they already know how it works.  They have a hard time telling somebody that doesn't have a clue, how to do it step by step.  They assume you have all the files you need, in the right locations, and the right project settings etc.... (that's why we hired technical writers....)

 

Thanks again, I'll let you know how it works out after we get back.

Just gettin' started, again....

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

Have a good trip.    The UK is still in "lockdown" for non-essential journeys.

 

I strongly advise mounting Arduino female headers on an XMINI.

You can put male headers in the other holes.  i.e.  breadboard friendly down or Dupont friendly up.

 

Then you get the best of all worlds.   Personally,   I use Arduino format shields for SAM, STM32, NXP, ... and XMINI-328P.

 

David.

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

As an aside - I suspect the reason for that annoying half-tenth offset on Arduino is so that you can't fit the sub-boards upside down...

 

Neil

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

barnacle wrote:

As an aside - I suspect the reason for that annoying half-tenth offset on Arduino is so that you can't fit the sub-boards upside down...

Design error.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

barnacle wrote:
so that you can't fit the sub-boards upside down...

There are plenty of ways to achieve that without the stupid spacing which renders everything incompatible wit the entire rest of the 0.1" universe!

 

 

joeymorin wrote:
Design error

Even that's a bit hard to swallow - as it's such a basic error.

 

It seems to me that it's a deliberate & wilful decision to lock the punters in, and lock standard 3rd-party stuff out.

 

angry

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

I had always understood that it was the "design error" i.e. a pcb layout mistake.

 

But in hindsight it was very wise.   It forced third party shields to conform.   And most importantly,  ensured that they only plugged in "one way".

ProtoShields offer 0.1" matrix with foolproof mating.

 

And it has ensured that every other MCU manufacturer provides evaluation boards with Arduino headers.

 

In practice,  Arduino as a company manufacture hardware boards.   People trust them.   They have profitable sales (as far as I know)

Third Parties make clone boards.   Some that improve on the original Arduino design.    They are cheaper.    They have profitable sales (as far as I know)

 

Punters can buy a wide range of boards, shields, modules, ... and use proven software.

Get help from anywhere in the world.

 

Everyone gets a coconut.

 

David.

Last Edited: Tue. May 19, 2020 - 08:12 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oops.

 

But then, my preferred platform is the Nucleo boards with strict 0.1" spacing everywhere except the Arduino sub-board compatibility pins...

 

Mind you, even they had some interesting design decisions - like using random pins for I/O serial and programming pins in such a way as there is no single port of which all 16 pins can be used without losing some other functionality... and very odd numbering!

 

Neil

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

The Nucleo boards are designed for Arduino compatibility.   Hence the Port/pin assignment.    It works pretty well.   e.g. SPI on D10-D13,   I2C on SDA, SCL, Analog on A0-A5

 

Yes,   I agree.   The Nucleo-64 boards do not have any spare contiguous port pins.   Even the Nucleo-144 seems to struggle on its Morpho headers.

 

The Discovery boards are better suited for contiguous pins.    But you can't plug one external board into different Discoverys.

 

The Nucleo-64 does keep pins in the same place.

The Freescale/NXP FRDM evaluation boards all vary in header wiring.

 

David. 

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

Even though it's a boneheaded move, I'm going with intentional a la Apple.  They just have to be different, and you need an Arduino approved shield to plug in there (tacitly approved, by conforming to their standard)

 

But it does key the boards so they can only be (easily) inserted one way.  There's other ways of doing that, but....   Whatever they did, it worked, everybody conforms to that pinout, Arduino wasn't forced to change.

Just gettin' started, again....

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

awneil wrote:

Even that's a bit hard to swallow - as it's such a basic error.

 

It seems to me that it's a deliberate & wilful decision to lock the punters in, and lock standard 3rd-party stuff out.

Yeah, I didn't buy that story either.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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


and it's worked - hasn't it ?

 

frown

 

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 David, for your time and efford.

I wish you could put up a tutorial on this (interfacing many projects together).I have tried continusly to understand what you did and what you mean in this example of OldMicoGuy,but I am not getting any near to the subject.

Sorry its the lack of knowledge  on my behalf ,not your quidence.

I may ask a few questions to try to understand you ,if I may?

Shall I?

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

azizollah wrote:
a tutorial on this (interfacing many projects together)

How about this:

 

https://www.avrfreaks.net/forum/tut-modularizing-c-code-managing-large-projects

 

And

 

http://c-faq.com/decl/decldef.html

 

maybe also

 

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

 

 

its the lack of knowledge  on my behalf

Did you take the time to watch the Studio basics videos?

 

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

 

 

I may ask a few questions to try to understand you ,if I may?

You may - but don't hijack unrelated threads.

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:
You may - but don't hijack unrelated threads.
Would you ever stop being so aggressive to genuine posters ??

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

Thank you  Clawson,

Never mind! We are used to this kind of aggressions!

Aziz

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

I did post my questions here (9 questions),but can not see them here,Did you delate it?

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

azizollah wrote:
I did post my questions here

Yes - you did hijack the thread!

 

So they were moved to their own thread:

 

https://www.avrfreaks.net/forum/can-solution-consist-1-many-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...
Last Edited: Wed. May 20, 2020 - 09:32 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm pretty sure I posted a comment to David also, did that get deleted in the process?  It was after azizollah's comment with the 9 questions.  

Just gettin' started, again....

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

It went with those questions to the new thread:

 

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

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 - 11:49 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, not a problem, just thought I posted it.  I tried before and guess I forgot to hit the post button, so I didn't want to write it a 3rd time.

Just gettin' started, again....