help with how to connect tlc5940 to atmega1284p (microduino core+)

Hello
I need to control 6 tlc5940nt chips to Microduino core+, which uses Atmega 1284p
The 1284p has timer 0,1,2,3 I believe and I am not sure which timer to use with blank, XLAT and GSCLK pin on the tlc5940. And I don’t know which pins to connect VPRG and DCPRG to. I am not planning to use XERR to read error. After doing some research I have come to the possible pin layout and I need someone to tell me which pin layout is the best.
The tlc5940 uses SPI interface, so I would use:
• (PCINT13/ICP3/MOSI) PB5 to SIN (TLC pin 26) /pin8 on Microduino core +
• (PCINT15/OC3B/SCK) PB7 to SCLK (TLC pin 25)/pin9 on Microduino core+

For the rest of the pins: I read blank and XALT needs to be on using the same frequency timer, so I am thinking for black and XLAT:
Option 1:
• ((PCINT28/XCK1/OC1B) to BLANK 16bit timer
• (PCINT29/OC1A) PD5 to XLAT 16bit timer

Option 2:
• (PCINT11/OC0A/AIN1) PB3 to XLAT 8bit timer
• (PCINT12/OC0B/SS) PB4 to blank 8bit timer
Option 3:
• PD7 (OC2A/PCINT31) 8 bit timer
• (PCINT30/OC2B/ICP) PD6 8 bit timer

I would not be able to use timer 3 as MOSI takes up on of the timer 3 pin, and I do not know if BLANK, XLAT and GSCLK needs to be on the same bit timer e.g.(16 bit timer)

For the GSCLK pin I am thinking of using:
• (PCINT9/CLKO/T1) PB1 , I got this idea form ‘demystifying tlc5940’
• (PCINT14/OC3A/MISO) PB6 16 bit timer
• (PCINT28/XCK1/OC1B) PD4
• (PCINT29/OC1A) PD5

If I use the last oc1b or oc1a pin for GSCLK, I would not be able to use it for blank and XLAT, I am not sure whether to use CLKO pin, can someone tell me what frequency it can run at, I read it can run at 16 MHz.

For VRPG and DCPRG I have no idea as what pin to use, so I need suggestions, but I am planning to use both dot correction and grayscale so I cannot simply connect them to VCC or GND

Please correct me if any of my concept understanding is wrong.
Once I figure out what pin to use I might post the schematics here.
One other thing is I can only find the Microduino core+ 644p schematics and not the 1284p versions schematic, if anyone knows anything please tell me.

If you were using an arduino UNO I,'d say your concept ia totally wrong becsuse you don't seem to be aware that the TLC55940 uses SPI protocol and there is a library that defines all the pins.

Thanks for the reply, but i am not using a arduino uno and hence i am not using the atmega 328p chip on the arduino uno. i am using a Microduino core+ 1284p performance edition. when you talked about the library, do you mean i should take a look at the given tlc5940 library for the arduino uno, and see which pin connects to which?

I'm saying I don't know anything about the 1284 so I don't know if it will work by redefining the pins to match the 1284 pinout.
The library was written for the TLC5940 . It doesn't care which uC is using it if that uC uses compatible code. Of course it wouldn't work with a PIC because the code is different but a PIC programmer who knows arduino code could re-write it to run on a PIC .
I think you should start with the assumption that if you can run arduino code , then you can redefine the pins. You may need to consult the datasheet but it might be doable. Looking at the "Basic Use "Sketch will tell you which arduino pins go where on the TLC5940. I have been advised that it looks like your shouting if you use all caps but after you read this I don't think you will mind.
DO NOT UNDER ANY CIRCUMSTANCES CONNECT THE POWER PINS TO THE TLC5940 WRONG !
YOU WILL FRY THE CHIP IN A HEARTBEAT !
DO NOT UNDER ANY CIRCUMSTANCES FORGET THE IREF RESISTOR ON PIN 20 OF THE CHIP AND CONNECT A JUMPER WIRE BY
MISTAKE ! YOU WILL FRY THE CHIP IN A HEARTBEAT !
IF YOU MISWIRE THE R(IREF) RESISOR ON PIN 20 TO +5V INSTEAD OF GROUND THE CHIP WILL NOT WORK BUT IT WILL NOT DAMAGE THE CHIP.
IF YOU USE TOO SMALL A RESISTOR ON PIN 20 YOU COULD DAMAGE THE CHIP AND THE LEDS !
IF YOU MAKE A MISTAKE AND FRY A CHIP IT WILL PROBABLY TAKE A WEEK TO GET ANOTHER. AT $5/EACH IT IS BETTER TO ORDER A COUPLE OF SPARES.

thanks for the reply, i looked at the tlc5940 ibrary and it seems to have atmegaxx4.h which i think includes 1284p, so i will look into that, thanks for the help. the thing is i have not got the parts yet(microduino), but i am designing the circuit board to host the tlc5940 and leds and i need to know what pins to connect the tlc5940 with. thanks you

Do you know how to daisy chain the chips ?

i believe so, all the pins (other than SIN) are connected to the previous chip's same pin. only one resistor connecting blank and VCC, For IREF each tlc5940 chips need to have its own resistor,like the picture i attached. i will use 2.2k ohm resistor for 18mAv each channel and 10k connecting blank and VCC. Please tell me if i am wrong. The only thing i am worried about is how to power the microduino, leds and tlc5940. Do i connect the 6 tlc5940 chips to the microduino's 5v power supply pin? and do i power the leds with separate power supply or connect them to the microduino's 3.3v pin. i have 6x16 LEDs, with 3.3 v rating and max 20mA. i appreciate your help. just to let you know, i am making a cylinder POV display as a school project.

i realize that the picture i attached(grabbed it off Google image) had the 5v connect 3.3v and could possible be a mistake. i might post my schematics up soon, hopefully.

Do i connect the 6 tlc5940 chips to the microduino's 5v power supply pin?

Not unless you only plan to run programs that sequence the leds one by one , rather than all on at the same time.
If you run any programs that turn all the leds on at the same time you need:
6x16x0.018A=1.92A. (IF ALL LEDS CAME ON AT ONCE) (about 2A)

The chip itself draws about 30- 50mA just for the chip (not including any leds)

and do i power the leds with separate power supply or connect them to the microduino's 3.3v pin.

NO . You need to supply +5Vdc on the ANODE of all the leds. The CATHODE of each led will connect to an output of the chip, as per your schematic. Again, as long as you only sequence the leds one at a time, you can power everything from the arduino +5V pin.
Make sure that pin goes to the +5V bus of your breadboard and that the ground from the arduino goes to the ground bus of your breadboard. If you set everything up for sequential operation and later you load a program that turns on all the leds at once , as soon as you see ALL the leds come ON, IMMEDIATELY TURN OFF THE POWER SUPPLY ! At this point you would disconnect the +5v from your arduino to the breadboard bus so you can upload the correct sketch.. This practice will prevent damage to your arduino regulator. Keep in mind that there may be some sketches that give the appearance of all the leds being on at once but in fact that is POV (Persistence Of Vision ) wherein your eyes and brain process the image and your brain holds that image long enough for the next led to come on making it look like they are both on etc... About the power supply, if you plan or want to turn all the leds on at once you will not be able to use the arduino power for the chips or the leds and plugging a large power supply into the dc jack of the arduino will not help. The +5V for the chips and leds will have to come from an external +5V power supply.
It is possible to build a 5V 5A power supply if you need one. I have a schematic.The chips and leds must retain a common ground with the arduino and no jumper wire can be plugged into the arduino +5V pin in that scenario. You will not be using the 3.3V pin of the arduino for anything. Do you understand why the chips are wired the way they are with all the pins connected together except the SIN ?

I will be turning on all the leds for my program and hence i will need to use an external power supply for the leds and the chips and one other power supply for the arduino right?i can use the 5v5A power supply you have for the leds and the chips ?it should use about 2A in total? right, would the difference in amps matter?if it works, can you please post the schematics, please.
about the way the chips are conneted, sin sends the data bite and fills up the chip register with the last chip first, all the other pin connection, like thr xlat and blank are pulse of high and low, so work for all the chips. i have rather bad explanation but i do think i understand.

Attached are two schematics for 5V power supplies. I recommend the 5A one because it uses the LM7805 regulator ic.
Make sure to mount the 2n2955 on a heatsink with mica insulator (radioshack) and thermal paste.

about the way the chips are conneted, sin sends the data bite and fills up the chip register with the last chip first, all the other pin connection, like thr xlat and blank are pulse of high and low, so work for all the chips. i have rather bad explanation but i do think i understand.

You are right about that but the answer I was looking for is that all those pins are connected to the SPI (Serial Peripheral Interface)
bus. (a group of connections (physical size depends on application. This is a logic application so a logic bus does not need large conductors like a power bus. The connections are similar to the edge connectors on plug in PCBs in a PC, like a video card. In this case the protocol is SPI which requires MISO (Master In-Slave Out), MOSI ( Master Out Slave In) SCK (Serial Clock) and SS (chip select) . The TLC5940 requires all of these EXCEPT MISO because it sends no data to the uC , only receives. That's why pin-12 of the arduino is not used. Also , the SS pin is redefinable, the others are not . EVERY SPI application you do with an arduino will require
the pins I just described but SS can be redefined to any pin so if you have 6 SPI devices that are NOT cascadable the TLC5940 ,you would pick pin 10 (DEFAULT SS) for the first device , and then any other pins you want for the rest , like 9,8,7,6,5 etc...
There are a zillian different kinds of ic's that use SPI bus protocol . I have used SPI digital 10k ohm pots that only receive commands to set the resistance. (SEE ATTACHED PROGRAM for FIVE digital pots. I started with six but fried one)
On the forum, you can usually find a library for the SPI chip you want to use that make it easy to use like the TLC5940. The reason I am telling you this is because if you ever want to use a SPI chip or device with your arduino again, the first thing you need to ask yourself is "Does it TALK, LISTEN , or BOTH ? How many chip selects will I need ? If it only LISTENS, you need pin-11. If it only TALKS , you need pin-12.If it does both, you need both. SCK is not redefinable (Pin-13) so you will always need that.When you have time, look up I2C /arduino examples. (I SQUARED C) (I - I C) (Inter-Integrated Circuit)

voltage-regulator-circuit.gif

FIVE_MCP4162_P_Digital_Pots_addr_2_delay_10.ino (2.88 KB)

Thanks, for the information. i would not be using any other device using the SPI interface other that the 6 tlc5940 and i was wondering would i still need the SS pin, and i don't know which pin on the tlc5940 i would connect the SS pin to. i read some where you just define the SS pin as output, without the need to connect it to tlc5940 and is that what is should do?please tell me what to do with the SS pin, thanks.

I don't think you understood my explanation about the TLC5940 or you didn't read the datasheet or both. The TLC5940 uses SPI
protocol. NO MATTER WHAT, ALL SPI DEVICE MUST HAVE A CHIP SELECT ! The "SS" pin , as you keep referring to it as , is the generic name for the chip select for a SPI device. This is the ONLY SPI pin on an arduino UNO that is redefinable , meaning you can change the pin number in the code to any pin you want because it is not hardcoded as a SPI pin like the other three SPI pins I already mentioned. You are not asking the right questions. The pinouts are shown in the "Basic Use" sketch in the TLC5940. I have already told you which pins a SPI device requires but you have not asked me which pins on a 1284 correspond to the pins you need to use the TLC5940. You have not posted the datasheet for the 1284 so how do you know how to connect it to a 1284? Did you find a schematic somewhere showing how to connect the TLC5940 to a 1284 ?

BasicUse.pde (4.08 KB)

tlc5940.pdf (1.3 MB)

just to see if I have misunderstanding on how the SS pin works, this is what I have understood so far: the master device is the arduino, and it has a SS pin that is not hardware specific, I need to connect the pin I defined as the SS pin on the arduino to the tlc5940's corresponding chip, and the arduino will send low and high pulse to tell the tlc5940 chip if it should read the data it is receiving in the MOSi line etc. this is probably a wrong concept I have and can you please tell me how it really works in detail.

The pinouts are shown in the "Basic Use" sketch in the TLC5940.

i took a look at the 'basic use' and i didn't find anything on the SS pin, would you be kind enough to point it out?

raschemmel:
I don't think you understood my explanation about the TLC5940 or you didn't read the datasheet or both.

I have read the tlc5940 full version datasheet, not the summary and I have also read the atmega 1284p data sheet. perhaps i didn't understand you, please bear with me.

raschemmel:
I have already told you which pins a SPI device requires but you have not asked me which pins on a 1284 correspond to the pins you need to use the TLC5940.

i think that was what I was trying to ask in my very first post, but I think it was too confusing and perhaps you didn't get me. basically I want to ask which timer on the atmega1284p to connect to the tlc5940's BLANK,XLAT and GSCLK.

raschemmel:
You have not posted the datasheet for the 1284 so how do you know how to connect it to a 1284? Did you find a schematic somewhere showing how to connect the TLC5940 to a 1284 ?

I have no found a schematic and was hoping after reading my first post someone can tell me what to do. i think the datasheet for the atmega 1284p is too big to be attached. i was hoping people can search that up themselves, sorry for the inconvenience.
The MOSI, SCLK and default SS pin on the atmega1284p seems pretty clear on the atmega1284p's datasheet, i am more unsure on what timer pins to use.

i read this online pdf: Matt Pandina and i didn't think i read on use of the SS pin, other than that it was set to output mode and used for the BLANK pin on the tlc5940.

Thank You very much for your help, much appreciated

I have read the tlc5940 full version datasheet, not the summary and I have also read the atmega 1284p data sheet. perhaps i didn't understand you, please bear with me.

LOOK AT PHYSICAL PINS 6,7,8 of the 1284 and tell me the signal names assigned to those pins.
pin-6=[NAME]
pin-7=[NAME]
pin-8=[NAME]

DO YOU SEE ANYTHING REMOTELY RELATED TO SPI PINS ?
Do you remember when I said this ?

In this case the protocol is SPI which requires MISO (Master In-Slave Out), MOSI ( Master Out Slave In) SCK (Serial Clock) and SS (chip select)

and this?

The TLC5940 requires all of these EXCEPT MISO because it sends no data to the uC , only receives.

So, in a nutshell, you read the complete datasheet but never looked at the pin names ?
Is that what I am to understand ?

i am very sorry we don't understand each other.i have looked at the pin layout and i know that atmega1284p has the MOSI, MISO, SCLK pin, and i know the MISO is not need for the tlc5940, the MOSI connects to the SIN pin of the tlc5940 and the SCK pin connects to the TLC5940's SCLK pin. what i am confused about is the SS pin of the atmega1284(which you said is a redefinable pin), is there a pin on the tlc5940 chip that i have to connect the SS pin of the 1284p to? if not, how does it work?
For the atmega1284 i am only unsure of the which timer pins to use, for the tlc5940 i am no sure on where the SS pin is.
please tell me if my concept of the use of the SS pin is wrong, thanks.

i do indeed read and remember all your post i assure you. Even though you sound really fustrated, i really Thank You for you help.

Please forgive me but right now i am doing my last year in high school and preparing fo the uni exam, so i have very little time to do reaserch, and i figure asking other for help would be easier. That is why i am askin gall these perhaps stupid questions. i hope you understand.

I have already told you which pins a SPI device requires but you have not asked me which pins on a 1284 correspond to the pins you need to use the TLC5940. You have not posted the datasheet for the 1284 so how do you know how to connect it to a 1284? Did you find a schematic somewhere showing how to connect the TLC5940 to a 1284 ?

I specifically asked this question to find out if you had taken the time to install the Library and look at it. If you had done that you would discover the folder named "Pinouts"

The MOSI, SCLK and default SS pin on the atmega1284p seems pretty clear on the atmega1284p's datasheet, i am more unsure on what timer pins to use.

When I read this I knew you had not installed the Library or looked at it.
Remember when you said this (back in Reply#4) ?

thanks for the reply, i looked at the tlc5940 ibrary and it seems to have atmegaxx4.h which i think includes 1284p, so i will look into that,

We are on Reply#17 now.
Is it possible that maybe that is why I sounded frustrated ?

what i am confused about is the SS pin of the atmega1284

Look at pin 5 of the 1284 pinout. It is labeled "SS". That is the pin you use for the SS pin. (redefinable simply means you could change it to some other pin if you wanted to).
Did you install the TLC5940 Library ?
If you install it and look in the library folder, you will see a subdirectory named "Pinouts"
If you look in that subdirectory you will see all the pinout files for different Atmel processors.
One of them is named "ATmega_xx4.h".
If you had installed the Library you would have found this folder.
This is the contents of the file I am talking about that is installed with the library.

/*  Copyright (c) 2009 by Alex Leone <acleone ~AT~ gmail.com>

    This file is part of the Arduino TLC5940 Library.

    The Arduino TLC5940 Library is free software: you can redistribute it
    and/or modify it under the terms of the GNU General Public License as
    published by the Free Software Foundation, either version 3 of the
    License, or (at your option) any later version.

    The Arduino TLC5940 Library is distributed in the hope that it will be
    useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with The Arduino TLC5940 Library.  If not, see
    <http://www.gnu.org/licenses/>. */

#ifndef TLC_ATMEGA_XX8_H
#define TLC_ATMEGA_XX8_H

/** \file
    SPI and timer pins for the ATmega164/324/644.  Don't edit these.  All
    changeable pins are defined in tlc_config.h */

/** VPRG (Sanguino digital pin 15) -> VPRG (TLC pin 27) */
#define DEFAULT_VPRG_PIN    PD7
#define DEFAULT_VPRG_PORT   PORTD
#define DEFAULT_VPRG_DDR    DDRD

/** XERR (Sanguino digital pin 6) -> XERR (TLC pin 16) */
#define DEFAULT_XERR_PIN    PB6
#define DEFAULT_XERR_PORT   PORTB
#define DEFAULT_XERR_DDR    DDRB
#define DEFAULT_XERR_PINS   PINB

/** SIN (Sanguino digital pin 5) -> SIN (TLC pin 26) */
#define DEFAULT_BB_SIN_PIN      PB5
#define DEFAULT_BB_SIN_PORT     PORTB
#define DEFAULT_BB_SIN_DDR      DDRB
/** SCLK (Sanguino digital pin 7) -> SCLK (TLC pin 25) */
#define DEFAULT_BB_SCLK_PIN     PB7
#define DEFAULT_BB_SCLK_PORT    PORTB
#define DEFAULT_BB_SCLK_DDR     DDRB

/** MOSI (Sanguino digital pin 5) -> SIN (TLC pin 26) */
#define TLC_MOSI_PIN     PB5
#define TLC_MOSI_PORT    PORTB
#define TLC_MOSI_DDR     DDRB

/** SCK (Sanguino digital pin 7) -> SCLK (TLC pin 25) */
#define TLC_SCK_PIN      PB7
#define TLC_SCK_PORT     PORTB
#define TLC_SCK_DDR      DDRB

/** SS will be set to output as to not interfere with SPI master operation.
    If you have changed the pin-outs and the library doesn't seem to work
    or works intermittently, make sure this pin is set correctly.  This pin
    will not be used by the library other than setting its direction to
    output. */
#define TLC_SS_PIN       PB4
#define TLC_SS_DDR       DDRB

/** OC1A (Sanguino digital pin 13) -> XLAT (TLC pin 24) */
#define XLAT_PIN     PD5
#define XLAT_PORT    PORTD
#define XLAT_DDR     DDRD

/** OC1B (Sanguino digital pin 12) -> BLANK (TLC pin 23) */
#define BLANK_PIN    PD4
#define BLANK_PORT   PORTD
#define BLANK_DDR    DDRD

/** OC2B (Sanguino digital pin 14) -> GSCLK (TLC pin 18) */
#define GSCLK_PIN    PD6
#define GSCLK_PORT   PORTD
#define GSCLK_DDR    DDRD

#endif

As you can see , the SS pin is clearly defined as :

#define TLC_SS_PIN       PB4

PIN PB4 is physical pin #5
The GSCLK pin is PD6.

 #define GSCLK_PIN    PD6

pin PD6 is physical pin #20
BLANK is pin PD4

#define BLANK_PIN    PD4

PIN PD4 is physical pin #18

If you look closely at the pin names on the 1284 pinout image I attached , you will see that the timers you asked about when you said this:

The MOSI, SCLK and default SS pin on the atmega1284p seems pretty clear on the atmega1284p's datasheet, i am more unsure on what timer pins to use.

are the pins I just mentioned above.
All of the TLC5940 signals are assigned 1284 pins in this file. It is a *.h header file so you can't open it with the IDE but you can open it with Word and save it as a .txt file for later.
All the other pins are SPI pins and you already know which ones those are.

ATmega_xx4.h (2.72 KB)

1284 pinouts.txt (2.8 KB)

ATmega_xx4.txt (2.8 KB)

Thanks again. I have not install the library file instead I have looked at it using word wrap. What happened is I didn'tfind 1284p in the xx4.h file,instead there is the 644,which at that time I was mot sure it has the same pin layout as the1284. also the file named chip included.h did not have 1284 in it. But now it seems you think it is compatible so I will go with that.Trust me I did go and look at the file. Which is why I am confused, I thought there would be a pin on the TLC5940 that you connect the ss pin and it didn't say in the library file where on the TLC5940 it is. but it seems once again I am wrong. Am I correct in saying this? So I just need to have ss pin defined in the library but I don't actually hook it up with the. TLC5940 right? You have been of most help to me thanks alot.

Trust me I did go and look at the file. Which is why I am confused, I thought there would be a pin on the TLC5940 that you connect the ss pin and it didn't say in the library file where on the TLC5940 it is.

what i am confused about is the SS pin of the atmega1284

Look at pin 5 of the 1284 pinout. It is labeled "SS". That is the pin you use for the SS pin. (redefinable simply means you could change it to some other pin if you wanted to).
Did you install the TLC5940 Library ?
If you install it and look in the library folder, you will see a subdirectory named "Pinouts"
If you look in that subdirectory you will see all the pinout files for different Atmel processors.
One of them is named "ATmega_xx4.h".
If you had installed the Library you would have found this folder.
This is the contents of the file I am talking about that is installed with the library.

 /** \file
    SPI and timer pins for the ATmega164/324/644.  Don't edit these.  All
    changeable pins are defined in tlc_config.h */

T rust me I did go and look at the file. Which is why I am confused, I thought there would be a pin on the TLC5940 that you connect the ss pin and it didn't say in the library file where on the TLC5940 it is. but it seems once again I am wrong. Am I correct in saying this? So I just need to have ss pin defined in the library but I don't actually hook it up with the. TLC5940 right?

Did you install the TLC5940 Library ?
If you install it and look in the library folder, you will see a subdirectory named "Pinouts"
If you look in that subdirectory you will see all the pinout files for different Atmel processors.
One of them is named "ATmega_xx4.h".
If you had installed the Library you would have found this folder.

I have not install the library file instead I have looked at it using word wrap.

Still you have not installed the Library. I am trying to be patient but really this is difficult. You have to install the library to see the file (unless you use the zip file viewer). The ATmega_xx4.h contains a statement that reads this:

 /** \file
    SPI and timer pins for the ATmega164/324/644.  Don't edit these.  All
    changeable pins are defined in tlc_config.h */

I have attached the ATmega_xx4.h and the tlc_config.h file as well as Word text file copies of these two.
As you noticed, the pinouts file only mentions these:

SPI and timer pins for the ATmega164/324/644.   (but NOT the 1284)

so I cannot say for certain that it will work. One thing is for sure , these files are part of the library. If you read my last post you know that the these files also mention the SS pin.

From the ATmega_xx4.h file in the Pinouts folder:

/** SS will be set to output as to not interfere with SPI master operation.
If you have changed the pin-outs and the library doesn't seem to work
or works intermittently, make sure this pin is set correctly. This pin
will not be used by the library other than setting its direction to
output. */
#define TLC_SS_PIN PB4
#define TLC_SS_DDR DDRB

Trust me I did go and look at the file. Which is why I am confused, I thought there would be a pin on the TLC5940 that you connect the ss pin and it didn't say in the library file where on the TLC5940 it is. but it seems once again I am wrong. Am I correct in saying this?

How can you look at the file if you didn't install the Library ? How can you look at the file I attached in the last post and not see this ?

/** SS will be set to output as to not interfere with SPI master operation.
If you have changed the pin-outs and the library doesn't seem to work
or works intermittently, make sure this pin is set correctly. This pin
will not be used by the library other than setting its direction to
output. */
#define TLC_SS_PIN PB4
#define TLC_SS_DDR DDRB

And now you are saying this?

So I just need to have ss pin defined in the library but I don't actually hook it up with the. TLC5940 right?

No. I am NOT saying that. I am saying AGAIN to drink 5 cups of coffee and read the ATmega_xx4.h file in the
PINOUTS folder. I attached this file to my last post. That file SPELLS OUT THE PINS TO USE FOR EVERYTHING. YOU NEED TO
CONNECT THOSE 1284 PINS (THE ONES IN THE ATmega1284PA-pinout.png image file. You read the ATmega_xx4.h file FIRST
THEN LOOK AT THE PINOUTS IMAGE FILE AND FIND THOSE PINS ON THE IMAGE FILE AND WRITE THOSE DOWN AND USE THOSE PINS . THE PINS IDENTIFIED ARE THE ONES YOU CONNECT AND THEIR PIN NAME IS SPECIFIED IT THE .h file. You write that pin name down , then look at the pinouts image file and you can see where those pins are. Those are the pins you connect .
Understand ?

ATmega_xx4.h (2.72 KB)

ATmega_xx4.txt (2.8 KB)

tlc_config.h (6.15 KB)