XMEGA256A3BU Xplained available I/O pins

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

Hi,

I've used all the available pins on the expansion headers of the Xplained board. This little board now controls 3 DDS oscillators, a 4-line by 20 character OLED display, an optical encoder, a multi-function menu switch, and 3 relay boards (14 band-pass filters, 4 crystal filters, and demodulation selection: AM or sideband). I need one more pin to control another relay board, and I think I will have the project finished.  I've already cut the DISPLAY_RS trace and using that I/O pin (PD0).

 

I'd like to use PD2 pin as the new relay board select line. The documentation states that this pin is used for Display and serial flash MISO input. However, I'm not using the FSTN display, nor am I using the AT45DB642D DataFlash device, just the flash and SRAM memory in the XMEGA256A3BU device. Is there any downside to using this pin for output only? I don't want to disable the JTAG to use one of the PB4-PB7 pins.

 

Any thoughts out there on the ability to using the serial flash control lines (PD1 - PD3) as I/O (in this case, output only)?

 

Thanks for looking,

Fred

This topic has a solution.
Last Edited: Fri. Jul 17, 2020 - 01:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

atlantaswl wrote:
a 4-line by 20 character OLED display
In 4 or 8 bit mode (assuming it offers this) ?

 

Another way to save pins to a display like this is a "backpack" in which you give the display it's own dedicated micro and then give it a low pin count interface to the "master" - so maybe SPI or I2C or UART or something. You then send it some kind of command protocol like "move to line 3, col 5" or "display the word "arradvark"" etc.

 

Other things you can so to save pins are to employ serial to parallel shift registers where there are multiple IO. Often things like a 595.

 

Yet another approach is where you have multiple button inputs, instead used a switched resistor ladder to a single ADC pin so you can read different buttons with different voltage levels. (can get tricky for simultaneous button presses though!)

 

But hopefully someone who know that Xplained will simply confirm you are OK with that pin! ;-)

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

atlantaswl wrote:
I'd like to use PD2 pin

Take a look at the schematics to see exactly what it does & where it goes.

 

They usually also give you the PCB layouts - so you can see where the traces go.

 

You say you've already cut one trace - so cutting another shouldn't be a problem ...

 

EDIT

 

https://www.microchip.com/wwwAppNotes/AppNotes.aspx?appnote=en591951 - you want the "Source Code" Zip.

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 - 05:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

atlantaswl wrote:
3 relay boards
  how are these controlled, could you use a serial to parallel shift register to be your i/o port expander (595) these take 3 pins if IIRC, but gives you 8 output pins, and can be daisy-chained for more outputs with no more pins used.

Lots of ways to get one more pin, but we will need details to suggest more (schematic)!

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

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

atlantaswl wrote:
I'm not using the FSTN display

Why not?

 

Wouldn't using that free-up the pins currently occupied by your off-board 4x20 display?

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

It is true, I could accomplish a lot in hardware to avoid using so many pins. But, I've used them all, and need one more. Very easy to add a trace and another 6 pin header to an existing PCB layout.

 

Fred

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

That hardware approach was my first thought. Three I/O pins to give me 8.  However, using a a pin that is not needed (FSTN display and external serial flash memory) seemed so easy: one more PCB trace, and one more 6-pin header is all that is needed.  The schematic of the interface board is complete, as is the PCB layout. Just need to know if I can co-opt that pin (or any of the 4) that is used for the FSTN display and serial flash chip. I'll bet I can, just noise on a line when the serial flash chip is not being accessed. If this doesn't work due to the serial flash chip, I can then choose the hardware approach.  I can also change the 8080 display interface to SPI and free up a few more pins. But, all the code for the display is written and tested. I'm very close to completing this. If I need to, I can program the AVR chip to use all the available pins using the STK600. That would require a lot more time designing a new PCB. Why would Atmel make the pin available on a header if it was unusable? I'll go ahead with the PCB manufacture and report the result here.

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

awneil wrote:

atlantaswl wrote:
I'm not using the FSTN display

Why not?

 

Wouldn't using that free-up the pins currently occupied by your off-board 4x20 display?

 

This is a 14 band receiver, and I'm not going to use a cheezy LCD display that would be invisible from about 6 inches away. This project has about 24 PCBs in it and will occupy a fair-sized cabinet. To squint at that LCD FSTN display in the front panel of this receiver would be a joke.

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

atlantaswl wrote:
Just need to know if I can co-opt that pin (or any of the 4) that is used for the FSTN display and serial flash chip. 

Again, the XPlained schematics should tell you that.

 

See #3

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: Thu. May 21, 2020 - 09:46 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

atlantaswl wrote:
Just need to know if I can co-opt that pin (or any of the 4) that is used for the FSTN display and serial flash chip. 

Again, the XPlained schematic should tell you that.

 

See #3

All the schematic tells me is if I remove the serial flash chip from the XPlained board, the PD0-PD3 pins become unused for any purpose and become available as general purpose I/O pins. Page 3 and 6 of the schematics show this. I just wanted to know if anyone has done what I am suggesting, without removing the serial flash chip. Thanks

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

Why not just cut the track(s) - thus removing all doubt?

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:

Why not just cut the track(s) - thus removing all doubt?

Cutting the traces will disconnect the header from the pin on the XMEGA processor (and the serial flash from the XMEGA processor as well). Have you looked at this XPlained board? You repeat multiple times to look at the schematic and you would know this if you had.

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

You asked for "any thoughts" - so those are my thoughts.

 

It's your project - so you need to do the detailed investigation.

 

Surely, you can find a place to cut to isolate the unwanted parts, while leaving the required connections in place. Or add a tack wire.

 

 

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...
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was able to test this morning; PD2 actually worked as a general purpose output pin, even though it is connected to the external flash memory.

 

Thanks everyone for your comments,

Fred