PORT E (Ethernut 1.3)

View: New views
5 Messages — Rating Filter:   Alert me  

PORT E (Ethernut 1.3)

by macsmaker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I'm having a difficult time using PORT E. In reading the Atmel 128 documentation, it appears for the most part the it should act like ports D and B, which I use all I/Os. The only?Port?pins (I/Os)?I appear to be able to control are 4, 6 and 7.



I've tried changing the alternate pin functions, but can't figure out how to access them. For example, the Atmel manual indicates settings in PVOExn where "x" is Port designation (B, D, E) and n is the I/O, but I get a compiler error when I try to use something like "PVOEE1," for example.



I use pins 6 and 7 with no problem, and I know 0 and 1 are used by the serial port. I really need two more, but I don't any confidence that I have figured pin 4.
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Re: PORT E (Ethernut 1.3)

by Ethernut :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In a first attempt I'll quote a reply I sent recently to a customer. May be this is sufficient. If not, please come back to me.

Here is my post:

For Ethernut 2 I can find this one
http://www.ethernut.de/en/hardware/enut2/ports.html
It is quite similar to 1.3, except for UART handshake and PB4 (Dataflash
CS) used on Ethernut 2, but not Ethernut 1.

You can use PB, PD and PE, except

PE0, PE1 (UART)
PE5 (IRQ)

As you already found, this gives 24 - 3 = 21 available ports.

Then, of course, you can use PF0-PF3.

And you can use PF4-PF7, if you disable JTAG by setting the JTD bit in
register MCUCSR. However, you need to make sure that your attached
hardware will not interfere when using JTAG. As long as you are using
the SP Duo programmer, you may then use SPI instead of JTAG. SPI
programming uses the UART lines and will not interfere with JTAG.

If you still need JTAG: As soon as JTD is set, you need to press the
reset button to enable JTAG again.

Address and data lines may be used too, but that becomes quite tricky,
because your running program needs them too.


Harald

_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Re: PORT E (Ethernut 1.3)

by macsmaker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Harald,

If I have 2,3,4,6 and 7, that is sufficient. Is there any special setup I
have to do for 2,3, or 4?

I tried setting 2 and 3 (making them outputs and then writing a 1 to the
proper port pin) but could not see any changes.



-----Original Message-----
From: en-nut-discussion-bounces@...
[mailto:en-nut-discussion-bounces@...] On Behalf Of Harald Kipp
Sent: Tuesday, September 08, 2009 7:14 AM
To: Ethernut User Chat (English)
Subject: Re: [En-Nut-Discussion] PORT E (Ethernut 1.3)

In a first attempt I'll quote a reply I sent recently to a customer. May be
this is sufficient. If not, please come back to me.

Here is my post:

For Ethernut 2 I can find this one
http://www.ethernut.de/en/hardware/enut2/ports.html
It is quite similar to 1.3, except for UART handshake and PB4 (Dataflash
CS) used on Ethernut 2, but not Ethernut 1.

You can use PB, PD and PE, except

PE0, PE1 (UART)
PE5 (IRQ)

As you already found, this gives 24 - 3 = 21 available ports.

Then, of course, you can use PF0-PF3.

And you can use PF4-PF7, if you disable JTAG by setting the JTD bit in
register MCUCSR. However, you need to make sure that your attached
hardware will not interfere when using JTAG. As long as you are using
the SP Duo programmer, you may then use SPI instead of JTAG. SPI
programming uses the UART lines and will not interfere with JTAG.

If you still need JTAG: As soon as JTD is set, you need to press the
reset button to enable JTAG again.

Address and data lines may be used too, but that becomes quite tricky,
because your running program needs them too.


Harald

_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Re: PORT E (Ethernut 1.3)

by Ethernut :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Pete Allison wrote:

> If I have 2,3,4,6 and 7, that is sufficient. Is there any special setup I
> have to do for 2,3, or 4?

PE2, PE3 and PE4 are directly connected to the expansion port.

Hardware: Do to mechanical stress, the vias may be broken. Try to
measure the result directly at the CPU pins.

Software: You enabled any special peripheral on these pins? You used the
right I/O call with the right bit/mask?
sbi(PORTE, PE4),
but outr(inr(PORTE), _BV(PE4));

Try something simple like
http://www.ethernut.de/nutwiki/Blinking_LED
first.

Harald
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

Re: PORT E (Ethernut 1.3)

by macsmaker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I use the following:

sbi(PORTE,X)/cbi(PORTE,X) where X is the bit number, to set and clear the
signal.

Example:

sbi(PORTE,6);

I use this technique for all I/Os I'm controlling, specifically in PORTS B &
D.

I've tried to set the appropriate DDRE bits to make 2,3,4,6 and 7 outputs,
leaving 0,1, and 5 alone.

I can toggle 4, 6 and 7 without problems. I cannot toggle 2 and 3 the same
way.

I'll check my setup code again.

Thanks, Pete Allison (Rogers Telecom Products)

-----Original Message-----
From: en-nut-discussion-bounces@...
[mailto:en-nut-discussion-bounces@...] On Behalf Of Harald Kipp
Sent: Tuesday, September 08, 2009 10:51 AM
To: Ethernut User Chat (English)
Cc: WROG1304@...
Subject: Re: [En-Nut-Discussion] PORT E (Ethernut 1.3)

Pete Allison wrote:

> If I have 2,3,4,6 and 7, that is sufficient. Is there any special setup I
> have to do for 2,3, or 4?

PE2, PE3 and PE4 are directly connected to the expansion port.

Hardware: Do to mechanical stress, the vias may be broken. Try to
measure the result directly at the CPU pins.

Software: You enabled any special peripheral on these pins? You used the
right I/O call with the right bit/mask?
sbi(PORTE, PE4),
but outr(inr(PORTE), _BV(PE4));

Try something simple like
http://www.ethernut.de/nutwiki/Blinking_LED
first.

Harald
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion

_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion