CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC18F87J60 I/O problems when using ethernet

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
EdwardH



Joined: 13 Jan 2009
Posts: 4

View user's profile Send private message

PIC18F87J60 I/O problems when using ethernet
PostPosted: Wed Jan 14, 2009 9:55 am     Reply with quote

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();
      }
     
   }
}
jgschmidt



Joined: 03 Dec 2008
Posts: 184
Location: Gresham, OR USA

View user's profile Send private message Send e-mail Visit poster's website

TCP/IP stack and I/O
PostPosted: Wed Jan 14, 2009 10:23 am     Reply with quote

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.
EdwardH



Joined: 13 Jan 2009
Posts: 4

View user's profile Send private message

PostPosted: Wed Jan 14, 2009 11:41 am     Reply with quote

That work fine. Thanks for the help.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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