Guest AtomSoft

TFT DDRx Error

Recommended Posts

Guest AtomSoft

Hey everyone... back again .. im lost here. I get a DDRC error on this code..

http://www.nuelectronics.com/estore/index.php?main_page=product_info&products_id=19

Im trying to use that code for a LCD i have just to see if it works... but i get the below error:

TFT_lib\TFT_ILI9325.cpp: In static member function 'static void LCD::init(uint8_t)':

TFT_lib\TFT_ILI9325.cpp:204: error: 'DDRC' was not declared in this scope"

Can someone please help me out... i have no clue with arduinos

Share this post


Link to post
Share on other sites

Hey AtomSoft,

I can explain this one, the AVR8 is based on the AtMega103 which is slightly different then the AtMega8/168/328 that the Arduino is based on. If you look at the AtMega103 datasheet you will see that PORTC is output only instead of bi-directional. For the Arduino chips PORTC is bi-directional, so the problem is that by default PORTC is not like the Arduino's PORTC.

But since this is an FPGA we can easily fix that, in the VHDL source code I hijacked a couple registers so we could make PORTC bi-directional. So the hardware supports PORTC being bi-directional, but the problem you are seeing is that I haven't updated the Arduino codebase with the defines for PORTC and PINC. You can do this for yourself by adding the following to your code:

#define DDRC _SFR_IO8(0x14)

#define PINC _SFR_IO8(0x13)

The best solution is for me to get these two lines of code into the modifications I've made to the Arduino IDE and make a new release. But I also want to upgrade to the latest version of the Arduino IDE too so I keep thinking I'm going to put aside some time and do all of the above.

Jack.

Share this post


Link to post
Share on other sites
Guest AtomSoft

Thanks, ill give that a shot. I have a new LCD coming in soon and would love to get this compiled :)

Compiled OK! Thanks... cant wait for this LCD...

Share this post


Link to post
Share on other sites
Guest AtomSoft

Ill be sure to bother you here :) thanks...

Also.. im about to test it on another LCD i have here... I have no clue if it will work or not... but im bored at the moment... Also i might be switching to Verilog...  since most of the examples i see are written in it... even tho i can read both languages it would save me time from converting from one to the other.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now