Discussion:
[Fx2lib-devel] Beginner question regarding I/O ports
Willem Jansen
12 years ago
Permalink
Hello fellow developers,

I have a simple beginner question regarding the I/O ports. I got a
simple Development Board of the 56pin version of the cy7c68013a.
(http://www.ebay.de/itm/EZ-USB-FX2LP-CY7C68013A-USB-Development-Core-Board-Module-Logic-Analyzer-EEPROM-/400470811401?pt=LH_DefaultDomain_77&hash=item5d3deba309)

To get started I want to see the I/O Pins of the chip to change from
3.3V to 0V and back. I therefore changed to lights-example as follows:

#include <fx2regs.h>

#include <lights.h>

#include <delay.h>


void main(void)

{

// loop endlessly

for(;;) {

delay(3000);

IOD=0x00;

delay(3000);

IOD=0xFF;

}

}



However, my voltmeter does not show any changes once I loaded it with
"sudo fx2load -v 0x04b4 -p 0x0082 build/lights.bix"

To be even more precise, I seems that all pins of the IOD-port are
somewhat disconnected, as there is no voltage difference neither to and
GND nor the 3.3V Pins.

Any ideas?

Regards,
Willem
--
-----------------------------
Willem Jansen
Daniel O'Connor
12 years ago
Permalink
<snip>
To be even more precise, I seems that all pins of the IOD-port are somewhat disconnected, as there is no voltage difference neither to and GND nor the 3.3V Pins.
I believe they are set to input so they will be floating.
You need to do the following to set turn the output enables on..
OED = 0xff;

Note that IFCFG1 and WORDWIDE can affect port D (they will switch it to its alternative function FD[15:8])

Hope that helps :)

BTW I found it quite helpful to configure UART 0 and write out debug messages to it (depends if you need both UARTs for your application though).

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
Chris McClelland
12 years ago
Permalink
That board uses the 56-pin package, which does not have any UARTs. You
can easily make a fast (115200) send-only software UART for debugging:

http://www.makestuff.eu/wordpress/debugging-cypress-fx2lp-firmware/
https://github.com/makestuff/libfpgalink/blob/master/firmware/fx2/debug.h
https://github.com/makestuff/libfpgalink/blob/master/firmware/fx2/debug.c

I found this invaluable during development of the FPGALink FX2 firmware.

Note that this code assumes there will be no interrupts during the
execution of usartSendByte(); if your firmware uses interrupts you'll
need to disable them on entry and re-enable them on exit.

Chris
...
Loading...