![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
EdwardH
Joined: 13 Jan 2009 Posts: 4
|
PIC18F87J60 I/O problems when using ethernet |
Posted: Wed Jan 14, 2009 9:55 am |
|
|
Hi,
I've got a PIC18F87J60 running the TCP server sample app and I've modified it to echo back any data sent via TCP, however as soon as I include the "ccstcpip.h" file any lines in my code that do things like output_low, output_high etc stop working. Any ideas as to why?
e.g. This code should toggle the B3 pin every 300 ticks, but it doesn't. I've even tried putting output_low at the start of the loop and output_high at the end, ignoring the tick count etc and it still doesn't work.
Code: | void main(void) {
TICKTYPE lastTick;
MACAddrInit();
IPAddrInit();
StackInit();
while(TRUE) {
StackTask();
MyTCPTask();
if (TickGet() > lastTick+300)
{
output_toggle(PIN_B3);
lastTick=TickGet();
}
}
} |
|
|
![](templates/subSilver/images/spacer.gif) |
jgschmidt
Joined: 03 Dec 2008 Posts: 184 Location: Gresham, OR USA
|
TCP/IP stack and I/O |
Posted: Wed Jan 14, 2009 10:23 am |
|
|
If you look at hardware.h, which is part of the TCP/IP stack, you will see #use fast_io(x) for ports A, B and C. This is different from the default standard_io used by the CCS compiler. With standard_io, CCS sets all the TRIS registers appropriately.
On a project I had I made sure TCP/IP was not using port B, for example,
and then commented out the #use fast_io(B).
Otherwise, you'll have to manually set the TRIS bits for the io ports you are using.
Actually, since you are not communicating to an external NIC, you can probably comment out all the fast_io statements. Try it, see what happens. Check the CCS help file for more information about fast vs standard IO. |
|
![](templates/subSilver/images/spacer.gif) |
EdwardH
Joined: 13 Jan 2009 Posts: 4
|
|
Posted: Wed Jan 14, 2009 11:41 am |
|
|
That work fine. Thanks for the help. |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|