ATmega32 and the TFT LCD

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
scancool
 
Posts: 19
Joined: Sat Jan 08, 2011 3:54 am

ATmega32 and the TFT LCD

Post by scancool »

I have the 2.8" 18-bit color TFT LCD with touchscreen breakout board - ILI9325 and an ATmega32 board with arduino bootloader that it works perfect,
the only problem I'm getting this error, with the Adafruit_TFTLCD.cpp
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:507:4: error: #error "No pins defined!"
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:525:4: error: #error "No pins defined!"
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:563:4: error: #error "No pins defined!"
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:594:4: error: #error "No pins defined!"
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp: In member function 'void Adafruit_TFTLCD::writeData(uint16_t)':
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:606: error: 'WRPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:606: error: 'WRPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:607: error: 'CSPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:607: error: 'CSPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:608: error: 'CDPORT' was not declared in this scope

and believe is because the analog port on the ATmega32 is on PORTA not on PORTC, can anyone let me know what should I been looking to change that, or is there anything else I'm missing to write to the correct port.

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: ATmega32 and the TFT LCD

Post by mtbf0 »

all through the library file there are bits of conditional compilation based on the type of processor used that define io functions for pins. you'll have to chose the pins you want to use on your mega32 then go through the library and add code for your processor. it will probably take a while, but shouldn't be anywhere near impossible.

scancool
 
Posts: 19
Joined: Sat Jan 08, 2011 3:54 am

Re: ATmega32 and the TFT LCD

Post by scancool »

that's what I though, can you give me an example of what part?
I did this one:
#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined (__AVR_ATmega328__) || defined(__AVR_ATmega8__) || defined(__AVR_ATmega32__)
#define WRPORT PORTA
#define RDPORT PORTA
#define CSPORT PORTA
#define CDPORT PORTA
#define WRPIN 1
#define CDPIN 2
#define CSPIN 3
#define RDPIN 0
and this
// comment or uncomment the next line for special pinout!
//#define USE_ADAFRUIT_SHIELD_PINOUT

but the errors still the same, so what should would be an example of something to change that would fix at least an error,

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ATmega32 and the TFT LCD

Post by adafruit_support_rick »

Arduino v0.22 does not natively support the 32U4 breakout board. Did you modify the distribution to add the 32U4 support? Do you have the correct board-type selected?

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: ATmega32 and the TFT LCD

Post by mtbf0 »

scancool wrote: C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:507:4: error: #error "No pins defined!"
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:525:4: error: #error "No pins defined!"
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:563:4: error: #error "No pins defined!"
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:594:4: error: #error "No pins defined!"
each of these errors has a line number. the code you need to modify will be a little above the referenced line number. try lines 494, 512, 530 and 569.

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: ATmega32 and the TFT LCD

Post by mtbf0 »

driverblock wrote:Arduino v0.22 does not natively support the 32U4 breakout board. Did you modify the distribution to add the 32U4 support? Do you have the correct board-type selected?
op said mega32, not mega32u4. based on the usage of porta, i'm thinking he or she meant what he or she said.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: ATmega32 and the TFT LCD

Post by adafruit_support_rick »

mtbf0 wrote:op said mega32, not mega32u4. based on the usage of porta, i'm thinking he or she meant what he or she said.
Ah - quite so. Didn't spot that.

scancool
 
Posts: 19
Joined: Sat Jan 08, 2011 3:54 am

Re: ATmega32 and the TFT LCD

Post by scancool »

thanks, I know the line number and I know they are things they have to be change in that line, but pointing out the obvious is not helping, yes and they a many errors too, if someone can tell me how to fix one would help a lot as reference to fix the others because the changes I done so far are not making a difference, this mega32 it works with any other library is just this library is reference the pins numbers and I want to know how to fix that and I had already read this, http://www.arduino.cc/en/Reference/PortManipulation so if know one knows the LCD library and how can I fix an error to make it work with ATmega32 it would help a lot I'm not being lazy I just need a reference point.

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: ATmega32 and the TFT LCD

Post by mtbf0 »

can't really provide any further guidance without knowing how you intend to connect the lcd. so far all we know is that you want to connect RD to PA0, WR to PA1, CD to PA2 and CS to PA3. there is no indication of where you want to connect the data pins.

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: ATmega32 and the TFT LCD

Post by mtbf0 »

if you want to hook it up PB0->D0, PB1->D!, PD2->D2, PD3->D3, PD4->D4, PD5->D5, PD6->D6 and PD7->D7 just change the lines i mentioned above to

Code: Select all

#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega328P__) || defined (__AVR_ATmega328__) || defined(__AVR_ATmega8__) || defined(__AVR_ATmega32__)
might work. i possess neither a mega32 nor the lcd nor have i modified my arduino environment to support the mega32, so testing's up to you.

scancool
 
Posts: 19
Joined: Sat Jan 08, 2011 3:54 am

Re: ATmega32 and the TFT LCD

Post by scancool »

thanks but I already done that, if you look the 3rd post you would see the changes I had made, the problem is not selecting the pins but to be able to compile without errors, I was thinking the errors are coming because the analog port on the mega32 is on port a and not c, but even after the modification the errors are the same,

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: ATmega32 and the TFT LCD

Post by mtbf0 »

sorry, the third post only shows one change. i didn't know you had made the others.

what are the errors you are currently getting? if none of them have gone away, then apparently you're not using the right symbol for the mega32.

nope. there it is, line 205 of io.h. so the symbol's right. so maybe it's not defined for your code.

maybe you could put something like this at the beginning of your sketch...

Code: Select all

#ifndef __AVR_ATmega32__
#error "What am i?"
#endif

scancool
 
Posts: 19
Joined: Sat Jan 08, 2011 3:54 am

Re: ATmega32 and the TFT LCD

Post by scancool »

this compile without any errors

Code: Select all

#ifndef __AVR_ATmega32__
#error "What am i?"
#endif
void setup() {                
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);     
}
void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(1000);              // wait for a second
}

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: ATmega32 and the TFT LCD

Post by mtbf0 »

ok, so arduino knows that it's compiling for a mega32.

can i see the current crop of errors?

and perhaps you could attach you current version of Adafruit_TFTLCD.cpp

scancool
 
Posts: 19
Joined: Sat Jan 08, 2011 3:54 am

Re: ATmega32 and the TFT LCD

Post by scancool »

this are all the errors and here is the version I'm using,
https://github.com/adafruit/TFTLCD-Library

Code: Select all

C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:507:4: error: #error "No pins defined!"
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:525:4: error: #error "No pins defined!"
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:563:4: error: #error "No pins defined!"
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:594:4: error: #error "No pins defined!"
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp: In member function 'void Adafruit_TFTLCD::writeData(uint16_t)':
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:606: error: 'WRPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:606: error: 'WRPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:607: error: 'CSPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:607: error: 'CSPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:608: error: 'CDPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:608: error: 'CDPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:609: error: 'RDPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:609: error: 'RDPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp: In member function 'void Adafruit_TFTLCD::writeRegister8(uint8_t, uint8_t)':
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:643: error: 'WRPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:643: error: 'WRPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:644: error: 'CSPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:644: error: 'CSPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:645: error: 'CDPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:645: error: 'CDPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:646: error: 'RDPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:646: error: 'RDPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp: In member function 'void Adafruit_TFTLCD::writeData_unsafe(uint16_t)':
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:690: error: 'WRPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:690: error: 'WRPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp: In member function 'void Adafruit_TFTLCD::writeCommand(uint16_t)':
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:711: error: 'WRPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:711: error: 'WRPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:712: error: 'CSPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:712: error: 'CSPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:713: error: 'CDPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:713: error: 'CDPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:714: error: 'RDPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:714: error: 'RDPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp: In member function 'void Adafruit_TFTLCD::writeCommand8(uint8_t)':
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:748: error: 'WRPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:748: error: 'WRPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:749: error: 'CSPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:749: error: 'CSPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:750: error: 'CDPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:750: error: 'CDPIN' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:751: error: 'RDPORT' was not declared in this scope
C:\Users\Andre\arduino-0022\libraries\LCDTFT\Adafruit_TFTLCD.cpp:751: error: 'RDPIN' was not declared in this scope

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”