All Forums
 Hardware
 General Hardware, ADSmartIO, Digital I/O and A/Ds
 portB as output
 Forum Locked
 Printer Friendly
Author Topic  

crf

7 Posts

Posted - 15 Jan 2004 :  13:07:45  Show Profile
Hi,
I have a little problem using SmartIO portB configured as output.
In detail, even if I try change PBx value, the output state does not change and the value returned by SIOReadPortB() is different from the value written using SIOWritePortB().

I am working with the following configuration:
- Graphics Client Plus (170110-8000F) 32+32 MB
- OS: windowsCE.Net v4.1
(ADS file: 700110 8143A_GCP_32MB_CE.NET_v411_IE_15MB.zip)
- SmartIO firmware version N.
(ADS file: 700110-4017N_GCPlus_ADSmartIO_reprog.zip)

I have also tried other versions of smartIO firmware with different behaviours:
+ Version J (ADS file: 700110-4017J_GCPlus_ADSmartIO_reprog.zip)
When the system boots PBx are not initialized (not all are off), then it is possible to control PB0, PB1 and PB2 but not PB3.

+ Version L (ADS file: 700110-4017L_GCPlus_ADSmartIO_reprog.zip)
When the system boots PBx are not initialized, only PB2 works fine.

+ Version N (ADS file: 700110-4017N_GCPlus_ADSmartIO_reprog.zip)
The same as version L.

I am using this src:

int iRetVal = LoadADSmartIOFunctions();
SIOSelectOption (3);
RETAILMSG (1,(L"\r\n* Device type %x, firmware version %x rev %c\r\n",
SIOReadDevicePartType(),
SIOFirmwareVersion(),
SIOReadDeviceVersion()));
SIOInitDDRC(0); // Configure port C as Input
SIOInitDDRB((BYTE)0xFF);// Configure port B as Output
SIOInitDDRD((BYTE)0x03);// Configure port D as Output

void CTest_SmartIO_dllDlg::OnCheckOut0()
{
UpdateData(true);
UINT uiPortB;
uiPortB = SIOReadPortB();
if (m_check_OUT0 == TRUE)
uiPortB = uiPortB | 0x01; // set bit 0
else
uiPortB = uiPortB & 0xFE; // clear bit 0

SIOWritePortB((BYTE)uiPortB);
RETAILMSG (1,(L"\r\n- SIOWritePortB(%d)\r\n", uiPortB));
uiPortB = SIOReadPortB();
RETAILMSG (1,(L"\r\n- SIOReadPortB() -->%d\r\n", uiPortB));
}
... so on for other PB bits.

---
Is there something wrong ?
Please, could someone help me?

Many thanks,
Regards

Marco.

akidder

1519 Posts

Posted - 16 Jan 2004 :  11:29:56  Show Profile
Hi Marco. Could you give this application (ZIP) a try? It's a test app I've used in the past to test operation of the digital I/Os.

For starters, try running it with nothing connected to the digital I/Os, just to make sure they aren't being tied up or down somehow by external circuitry.

Results are streamed out to the debug port. Sample output is included in the zip file.

Let us know what you find!

Cheers, Drew

p.s. This app was designed to ferret out the weak spots in various revisions. Some ADSmartIO builds are better at protecting reserved bits than others. Let us know if you find a problem with one of our more current ADSmartIO releases!

Go to Top of Page

crf

7 Posts

Posted - 17 Jan 2004 :  05:37:21  Show Profile
Many thanks for your reply,
I tried you test application on my target and, even if the smartIO behaviour is quite different from the results of my first test, some problem are still open.
1) Port B seems to be not initialized: during the OS boot PB1 is ON and, at the end of boot phase also PB0 is swithed ON. Is this a debug output or that bits are dedicated to internal function ?
2) Running you test PB0 and PB1 are always ON, even if the source code writes 0x00 to port B.
It is visible in the test output. By the way, there is not difference from my test output and the "sample output.txt" that I found in your zip file.
....
* Now toggling all ADSmartIO ports with 0x00/55/AA/FF...
100:
00: a=00 b=03 c=00 d=00
FF: a=FF b=0F c=FF d=03
AA: a=AA b=0B c=AA d=02
55: a=55 b=07 c=55 d=01
....
In the smartIO manual I read that only PB4,5,6,7 are reserved; so PB0-3 should be available.
Please could you investigate the problem ? The HW we developed is based on PB0-3 digital ouput, so we need of them!

Thank you wery much,
Regards.

Marco
Go to Top of Page

akidder

1519 Posts

Posted - 19 Jan 2004 :  18:12:25  Show Profile
Hi Marco:

Thakns for your note. Revisions D and later of the GC Plus use PB0 and PB1 as an I2C bus to communicate with the real-time clock. You can read more about this update in this addendum to the GC Plus user's manaul posted here on the forums.

We started supporting the RTC in rev L of the 4017 firmware. If it's critical for your application to use those AVR GPIOs, maybe you could go back to rev J (see topic 306 for downloads; I'll post a 4017 revision history tomorrow).

If that won't do, email us with details about your requirements and we'll see how we can help!
Go to Top of Page
  Topic  
 Forum Locked
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.03 seconds. Snitz Forums 2000