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 support@ccsinfo.com

Olimex Mini-Web setup for CCS TCP/IP

 
Post new topic   Reply to topic    CCS Forum Index -> Code Library
View previous topic :: View next topic  
Author Message
jgschmidt



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

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

Olimex Mini-Web setup for CCS TCP/IP
PostPosted: Sun Dec 21, 2008 3:16 am     Reply with quote

I have made the necessary additions to CCSTCPIP.H and HARDWARE.H to support the Olimex PIC-MINI-WEB development board. This is probably the cheapest, yet still useful, PIC/Ethernet board available. Sparkfun has it for about $40. You couldn't make it yourself for that. Don't forget to get the ICSP cable set for it.

I have tested this with some of the TCP/IP tutorial exercises: DHCP works and it responds to PING.

You do need the PCH or PCWH compiler for this. Also beware that the Olimex boards come with software loaded. This will replace it!

Here is the CCSTCPIP.H:
Code:
//////////////////////////////////////////////////////////////////////////////
//
// ccstcpip.h - Common code shared among all Embedded Internet/Embedded
// Ethernet tutorial book examples.
//
// If you are using a CCS Embedded Ethernet Board (labeled PICENS, which
// has an MCP ENC28J60) then define STACK_USE_CCS_PICENS to TRUE.
//
// If you are using a CCS Embedded Internet Board (labeled PICNET, which
// has a Realtek RTL8019AS and a 56K Modem) then define STACK_USE_CCS_PICNET
// to TRUE.
//
//////////////////////////////////////////////////////////////////////////////
//
// 10/25/06
//  - Added STACK_USE_CCS_PICEEC
//  - ExampleUDPPacket[] UDP header length fixed
//
// 2008.12.20 - JGSCHMIDT
// - added STACK_USE_CCS_OLXMINI for Olimex Mini-Web board
//
//////////////////////////////////////////////////////////////////////////////

#define STACK_USE_CCS_PICENS     0 //18f4620 + enc28j60
#define STACK_USE_CCS_PICNET     0 //18f6722 + realtek
#define STACK_USE_CCS_PICEEC     0 //18f97j60
#define STACK_USE_CCS_OLXMINI    1 //Olimex Mini-Web 18f25j10 + enc28j60

#if STACK_USE_CCS_PICENS
 #define STACK_USE_MCPENC 1
#endif

#if STACK_USE_CCS_OLXMINI
 #define STACK_USE_MCPENC 1
#endif

#if STACK_USE_CCS_PICEEC
 #define STACK_USE_MCPINC 1
#endif

#if STACK_USE_CCS_PICENS
 #include <18F4620.h>
 #use delay(clock=40M)
 #fuses H4, NOWDT, NOLVP, NODEBUG
 
#elif STACK_USE_CCS_PICNET
 #include <18F6722.h>
 #use delay(clock=40M)
 #fuses H4, NOWDT, NOLVP, NODEBUG
 
#elif STACK_USE_CCS_PICEEC
 #include <18F67J60.h>
 //#use delay(clock=41666667)
 //#fuses NOWDT, NODEBUG, H4_SW, NOIESO, NOFCMEN, PRIMARY
 #use delay(clock=25M)
 #fuses NOWDT, NODEBUG, HS, NOIESO, NOFCMEN, PRIMARY, ETHLED
 
#elif STACK_USE_CCS_PICNET_OLD
 #include <18F6720.h>
 #use delay(clock=20M)
 #fuses HS, NOWDT, NOLVP, NODEBUG
 #define STACK_USE_CCS_PICNET   TRUE

#elif STACK_USE_CCS_OLXMINI
 #include <18F25J10.h>
 #use delay(clock=40M, oscillator=10M)
 #fuses H4_SW, NOWDT, NODEBUG
 #else

 #error You need to define your custom hardware

#endif

#if STACK_USE_CCS_OLXMINI
 // There is no level-shifter (MAX3232) on the board so I could not
 // use the UART
 #use rs232(baud=9600, XMIT=PIN_A1, INVERT)
#else
 #use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
#endif

#include "tcpip/stacktsk.c"    //include Microchip TCP/IP Stack

#if STACK_USE_CCS_PICENS
 #include "tcpip/mlcd.c"
 #define BUTTON1_PRESSED()  (!input(PIN_A4))
 #define USER_LED1    PIN_A5
 #define USER_LED2    PIN_B4
 #define USER_LED3    PIN_B5
 #define LED_ON       output_low
 #define LED_OFF      output_high
 #define STANDARD_ADC_STRING  "AN0"
 #define STANDARD_ADC_CHANNEL 0
 void init_user_io(void) {
   setup_adc(ADC_CLOCK_INTERNAL);
   setup_adc_ports(AN0);
   *0xF92=(*0xF92 & 0xDF) | 0x11;   //a5 output, a4 and a0 input
   *0xF93=*0xF93 & 0xCF;   //b4 and b5 output
   LED_OFF(USER_LED1);
   LED_OFF(USER_LED2);
   LED_OFF(USER_LED3);
   set_adc_channel(0);
 }

#elif STACK_USE_CCS_PICEEC
 #include "tcpip/elcd.c"
 #define BUTTON1_PRESSED()  (!input(PIN_A4))
 #define USER_LED1    PIN_B3
 #define USER_LED2    PIN_B4
 #define USER_LED3    PIN_B5
 #define LED_ON       output_low
 #define LED_OFF      output_high
 #define STANDARD_ADC_STRING  "AN2"
 #define STANDARD_ADC_CHANNEL 2
 void init_user_io(void) {
   setup_adc(ADC_CLOCK_INTERNAL);
   setup_adc_ports(AN0_TO_AN2);
   set_adc_channel(2);
   *0xF92=*0xF92 & 0xFC;   //a0 and a1 output
   *0xF93=*0xF93 & 0xC7;   //b3, b4 and b5 output
   LED_OFF(USER_LED1);
   LED_OFF(USER_LED2);
   LED_OFF(USER_LED3);
   set_adc_channel(2);
 }

#elif STACK_USE_CCS_OLXMINI            // JGS 2008.12.20
// #include "tcpip/elcd.c"
 #define BUTTON1_PRESSED()  (!input(PIN_B0))
 #define USER_LED1    PIN_C2
 #define LED_ON       output_low
 #define LED_OFF      output_high
// #define STANDARD_ADC_STRING  "AN2"
// #define STANDARD_ADC_CHANNEL 2

void init_user_io(void) {
//   setup_adc(ADC_CLOCK_INTERNAL);
//   setup_adc_ports(AN0_TO_AN2);
//   set_adc_channel(2);
//   *0xF92=*0xF92 & 0xFC;   //a0 and a1 output
//   *0xF93=*0xF93 & 0xC7;   //b3, b4 and b5 output
   LED_OFF(USER_LED1);
//   LED_OFF(USER_LED2);
//   LED_OFF(USER_LED3);
//   set_adc_channel(2);
 }

#else

 #include "tcpip/dlcd.c"
 #define BUTTON1_PRESSED()  (!input(PIN_B0))
 #define BUTTON2_PRESSED()  (!input(PIN_B1))
 #define USER_LED1    PIN_B2
 #define USER_LED2    PIN_B4
 #define LED_ON       output_low
 #define LED_OFF      output_high
 #define STANDARD_ADC_STRING  "AN0"
 #define STANDARD_ADC_CHANNEL 0
 void init_user_io(void) {
   setup_adc(ADC_CLOCK_INTERNAL );
   setup_adc_ports(ANALOG_AN0_TO_AN1);
   *0xF92=*0xF92 | 3;            //a0 and a1 input (for ADC)
   *0xF93=(*0xF93 & 0xEB) | 3;   //B0 and B1 input, B2 and B4 output
   LED_OFF(USER_LED1);
   LED_OFF(USER_LED2);
   set_adc_channel(0);
 }
#endif

void MACAddrInit(void) {
   MY_MAC_BYTE1=0;
   MY_MAC_BYTE2=2;
   MY_MAC_BYTE3=3;
   MY_MAC_BYTE4=4;
   MY_MAC_BYTE5=5;
   MY_MAC_BYTE6=6;
}

void IPAddrInit(void) {
   //IP address of this unit
   MY_IP_BYTE1=192;
   MY_IP_BYTE2=168;
   MY_IP_BYTE3=100;
   MY_IP_BYTE4=7;

   //network gateway
   MY_GATE_BYTE1=192;
   MY_GATE_BYTE2=168;
   MY_GATE_BYTE3=100;
   MY_GATE_BYTE4=1;

   //subnet mask
   MY_MASK_BYTE1=255;
   MY_MASK_BYTE2=255;
   MY_MASK_BYTE3=255;
   MY_MASK_BYTE4=0;
}


char ExampleIPDatagram[] = {
   0x45, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
   0x64, 0x11, 0x2A, 0x9D, 0x0A, 0x0B, 0x0C, 0x0D,
   0x0A, 0x0B, 0x0C, 0x0E
};

char ExampleUDPPacket[] = {
   0x04, 0x00, 0x04, 0x01, 0x00, 0x08, 0x00, 0x00,
   0x01, 0x02, 0x03, 0x04
};

Here is the HARDWARE.H:
Code:
///////////////////////////////////////////////////////////////////////////
////                                                                   ////
////                         HARDWARE.H                                ////
////                                                                   ////
//// Hardware I/O definitions and TCP/IP stack configuration settings. ////
////                                                                   ////
//// These values will probably change with each application.          ////
////                                                                   ////
///////////////////////////////////////////////////////////////////////////
////                                                                   ////
//// RELEASE HISTORY:                                                  ////
////                                                                   ////
////    Jan 15, 2004: MODEM_RESPONSE_TIMEOUT and MODEM_CONNECT_TIMEOUT ////
////                  moved to here.                                   ////
////                                                                   ////
////    Jan 09, 2004: Initial Public Release                           ////
////                                                                   ////
///////////////////////////////////////////////////////////////////////////
////        (C) Copyright 1996,2004 Custom Computer Services           ////
//// This source code may only be used by licensed users of the CCS C  ////
//// compiler.  This source code may only be distributed to other      ////
//// licensed users of the CCS C compiler.  No other use, reproduction ////
//// or distribution is permitted without written permission.          ////
//// Derivative programs created using this software in object code    ////
//// form are not restricted in any way.                               ////
///////////////////////////////////////////////////////////////////////////
//
// 2008.12.20 - JGSCHMIDT
// - added STACK_USE_CCS_OLXMINI for Olimex Mini-Web board

#IFNDEF ___TCPIP_STACK_CONFIGURATION
#define ___TCPIP_STACK_CONFIGURATION


#ifndef STACK_USE_CCS_PICNET
#define STACK_USE_CCS_PICNET  FALSE
#endif

#ifndef STACK_USE_CCS_PICENS
#define STACK_USE_CCS_PICENS  FALSE
#endif

#use fast_io(A)
#use fast_io(B)
#use fast_io(C)
#if STACK_USE_CCS_PICNET || STACK_USE_CCS_PICEEC || STACK_USE_CCS_EWL3V
 #use fast_io(F)
#endif


//// VARIOUS MODEM SETTINGS.
   #DEFINE  MODEM_DCD         PIN_G3
   #DEFINE  MODEM_RESET       PIN_G4
   #define  MODEM_TX          PIN_G1
   #define  MODEM_RX          PIN_G2
   #DEFINE  MODEM_INIT_STR    "ATM1L3&K0"   //speaker on, volume high, no hw flow control
   #DEFINE  MODEM_DIAL_STR    "ATDT"
   #DEFINE  MODEM_BAUD_RATE   115200

   #DEFINE  MODEM_RESPONSE_TIMEOUT  2000     //time to wait for a response to an AT command (in ms)
   #DEFINE  MODEM_CONNECT_TIMEOUT   120000    //time to wait for modem to make a connection (in ms)


//// VARIOUS MAC/NIC SETTINGS.
   #if STACK_USE_CCS_PICNET
      //Latch and Directional control SFR locations for the 3 control pins
      #define NIC_RESET_LAT       LATE_RE7
      #define NIC_IOW_LAT         LATE_RE6
      #define NIC_IOR_LAT         LATE_RE5
      #define NIC_RESET_TRIS      TRISE_RE7
      #define NIC_IOW_TRIS        TRISE_RE6
      #define NIC_IOR_TRIS        TRISE_RE5

      //Latch and Directional control SFR locations for the 5bit address port
      #define NIC_ADDR_LAT        LATE
      #define NIC_ADDR_TRIS       TRISE

      //Latch, Directional and I/O SFR locations for the 8bit data port
      #define NIC_DATA_IO         PORTF
      #define NIC_DATA_LAT        LATF
      #define NIC_DATA_TRIS       TRISF

      //This macro takes an address and properly outputs it on the latch register, and sets proper pins to output.
      //Leaves other pins alone.
      #define WRITE_NIC_ADDR(a)   NIC_ADDR_LAT = (NIC_ADDR_LAT & 0xE0)|a; \
                                NIC_ADDR_TRIS = NIC_ADDR_TRIS & 0xE0
   #elif STACK_USE_CCS_PICENS
      #define PIN_ENC_MAC_SO  PIN_C4   // PIC <<<< ENC
      #define PIN_ENC_MAC_SI  PIN_C5   // PIC >>>> ENC
      #define PIN_ENC_MAC_CLK PIN_C3
      #define PIN_ENC_MAC_CS  PIN_D1
      #define PIN_ENC_MAC_RST PIN_D0
      #define PIN_ENC_MAC_INT PIN_B0
      #define PIN_ENC_MAC_WOL PIN_B1
      #define ENC_MAC_USE_SPI TRUE      //due to an errata in the ENC28J60, you should always use HW SPI to assure that SPI clock is over 8MHz!
      #define mac_enc_spi_tris_init()  TRISB=(TRISB | 0b11); TRISC = (TRISC & 0b11010111) | 0x10; TRISD=TRISD & 0xF4 //was 0xFC

   #elif STACK_USE_CCS_OLXMINI
      #define PIN_ENC_MAC_SO  PIN_C4   // PIC <<<< ENC
      #define PIN_ENC_MAC_SI  PIN_C5   // PIC >>>> ENC
      #define PIN_ENC_MAC_CLK PIN_C3
      #define PIN_ENC_MAC_CS  PIN_B3
      #define PIN_ENC_MAC_RST PIN_B5
      #define PIN_ENC_MAC_INT PIN_B2
      #define PIN_ENC_MAC_WOL PIN_B1
      #define ENC_MAC_USE_SPI TRUE      //due to an errata in the ENC28J60, you should always use HW SPI to assure that SPI clock is over 8MHz!
      #define mac_enc_spi_tris_init()  TRISB=(0b110); TRISC = (TRISC & 0b11010111) | 0x10; TRISD=TRISD & 0xF4//was 0xFC

   #elif STACK_USE_CCS_EWL5V
      #define PIN_ENC_MAC_SO  PIN_C4   // PIC <<<< ENC
      #define PIN_ENC_MAC_SI  PIN_C5   // PIC >>>> ENC
      #define PIN_ENC_MAC_CLK PIN_C3
      #define PIN_ENC_MAC_CS  PIN_A4
      #define PIN_ENC_MAC_RST PIN_B5
      #define PIN_ENC_MAC_INT PIN_B2
      #define PIN_ENC_MAC_WOL PIN_B3
      #define ENC_MAC_USE_SPI TRUE      //due to an errata in the ENC28J60, you should always use HW SPI to assure that SPI clock is over 8MHz!
      #define mac_enc_spi_tris_init()  TRISB=(TRISB | 0b00001100)&0b11011111; TRISC = (TRISC & 0b11010111) | 0x10; TRISA=TRISA & 0b11101111

   #elif STACK_USE_CCS_PICEEC||STACK_USE_CCS_EWL3V
      //no hardware definitions - everything is internal
   #else
      #error Please define your MAC/NIC I/O settings
   #endif



//// SET TCP_NO_WAIT_FOR_ACK TO FALSE IF TCP STACK SHOULD WAIT FOR ACK FROM
//// REMOTE HOST BEFORE TRANSMITTING ANOTHER PACKET.  THIS MAY REDUCE THROUGHPUT.
//// DEFAULT VALUE (TRUE) GETS LOADED IN TCP.H IF THIS LINE IS REMOVED.
   #define TCP_NO_WAIT_FOR_ACK   FALSE


///DEFAULT HARDCODED IP ADDRESSES.
///  FUTURE APPLICATIONS MAY WANT TO SAVE THESE TO AN EEPROM.
///  OR USE AUTO IP ASSIGNMENT (DHCP).
///  NO TWO DEVICES ON A NETwORK CAN HAVE THE SAME IP ADDRESS
   #define MY_DEFAULT_IP_ADDR_BYTE1        10   //IP ADDRESS
   #define MY_DEFAULT_IP_ADDR_BYTE2        10   // This unit's IP address.
   #define MY_DEFAULT_IP_ADDR_BYTE3        5
   #define MY_DEFAULT_IP_ADDR_BYTE4        15

   #define MY_DEFAULT_MASK_BYTE1           0xff //NETMASK
   #define MY_DEFAULT_MASK_BYTE2           0xff // Netmask tells the IP / ARP stack which
   #define MY_DEFAULT_MASK_BYTE3           0xff // IP's are on your local network.
   #define MY_DEFAULT_MASK_BYTE4           0x00

   #define MY_DEFAULT_GATE_BYTE1           192  //GATEWAY IP ADDRESS
   #define MY_DEFAULT_GATE_BYTE2           168  // Gateway acts as a conduit between two networks.
   #define MY_DEFAULT_GATE_BYTE3           100
   #define MY_DEFAULT_GATE_BYTE4           1

///DEFAULT HARDCODED MAC ADDRESS.
///  FUTURE APPLICATIONS MAY WANT TO SAVE THIS TO AN EEPROM, OR GENERATE
///  A DYNAMIC ONE BASED UPON UNIT'S SERIAL NUMBER.
///  NO TWO DEVICES ON THE SAME ETHERNET NETWORK CAN HAVE THE SAME MAC ADDRESS.
#define MY_DEFAULT_MAC_BYTE1            0x00
#define MY_DEFAULT_MAC_BYTE2            0x04
#define MY_DEFAULT_MAC_BYTE3            0xa3
#define MY_DEFAULT_MAC_BYTE4            0x00
#define MY_DEFAULT_MAC_BYTE5            0x00
#define MY_DEFAULT_MAC_BYTE6            0x00

///Maximum sockets to be defined.
/// Note that each socket consumes 36 bytes of RAM.
/// If you remove this, a default value will be loaded in stacktsk.h
   #ifndef MAX_SOCKETS
   #define MAX_SOCKETS                     5
   #endif

///Avaialble UDP Socket
/// DCHP takes 1 socket.
/// If you remove this, a default value will be loaded in stacktsk.h
   #ifndef MAX_UDP_SOCKETS
   #define MAX_UDP_SOCKETS                 2
   #endif

///BUFFER SIZE DEFINITIONS
///
/// For SLIP, there can only be one transmit and one receive buffer.
/// Both buffer must fit in one bank.  If bigger buffer is required,
/// you must manually locate tx and rx buffer in different bank
/// or modify your linker script file to support arrays bigger than
/// 256 bytes.
/// I think Microchip needs MAC_RX_BUFFER_SIZE to equal MAC_TX_BUFFER_SIZE
///
/// For PPP, there can only be one transmit and one receive buffer.
/// You can receive messages larger than the receive buffer if your
/// routines are fast enough.  You cannot transmit messages larger
/// than the TX buffer.  The larger the buffer you can make, the better.
/// BUG: MAC_RX_BUFFER_SIZE must equal MAC_TX_BUFFER_SIZE
///
/// For Ethernet, the Ethernet controler has many buffers that are
/// 1k in size.   Only one buffer is used for TX, rest are for RX.
/// Unlike SLIP and PPP, no RAM is used for these buffers.
   #if STACK_USE_MAC
       #define MAC_TX_BUFFER_SIZE          1024 //do not modify this line
       #define MAC_TX_BUFFER_COUNT         1    //do not modify this line
   #elif STACK_USE_PPP
       #define MAC_TX_BUFFER_SIZE          1024
       #define MAC_TX_BUFFER_COUNT         1
   #elif STACK_USE_SLIP
       #define MAC_TX_BUFFER_SIZE          250
       #define MAC_TX_BUFFER_COUNT         1
   #endif

   #define MAC_RX_BUFFER_SIZE              MAC_TX_BUFFER_SIZE  //do not modify this line unless you are certain you know what you're doing

#endif

And here is the test program:
Code:
// olx-mini-dhcp.c
//////////////////////////////////////////////////////////////////////////////
//
// ex11.c - Example 11 from the Embedded Internet/Embedded Ethernet tutorial
//
// Network configuration is done automatically using DHCP.  Results, including
// the assigned IP address, is displayed on the LCD.
//
// Note: This will only work on a network that has a DHCP server.
//
//////////////////////////////////////////////////////////////////////////////
//
// 2008.12.20  JGSchmidt - modified for Olimex Mini-Web board

#define STACK_USE_ICMP  1
#define STACK_USE_ARP   1
#define STACK_USE_DHCP  1
#include "ccstcpip.h"

#define DISPLAYWAIT  1     // seconds
//-----------------------------------------------------------------------------

void LCDTask(void) {
   // no LCD on mini-web so continue with serial output
   static TICKTYPE lastTick;
   static enum {LCD_Display=0, LCD_Wait=1} state=0;

   switch(state) {
      case LCD_Display:
         if (!MACIsLinked()) {
            printf("No Ethernet\n");
         }
         else if (!DHCPIsBound()) {
            printf("DCHP Not Bound\n");
         }
         else {
            printf("%u.%u.%u.%u\n", MY_IP_BYTE1, MY_IP_BYTE2,
               MY_IP_BYTE3, MY_IP_BYTE4);
         }
         lastTick=TickGet();
         state=LCD_Wait;
         break;

      case LCD_Wait:
         if (TickGetDiff(TickGet(), lastTick) >= TICKS_PER_SECOND * DISPLAYWAIT)
            state=LCD_Display;
         break;
   }
}

//-----------------------------------------------------------------------------
void main(void)
{
   delay_ms(100);       // allow some settle time
   printf("CCS TCP/IP TUTORIAL, EXAMPLE 11 (DHCP)\r\n");

   MACAddrInit();
   StackInit();

   while(TRUE) {
      StackTask();
      LCDTask();
   }
}
//-----------------------------------------------------------------------------
//------ end of olx-mini-dhcp.c

And if you are interested, here is just a general purpose .H file for the board:
Code:
// olimex1.h
//
// Olimex Mini-Web Server Board PIC-MINI-WEB Rev.C
//
// 2008.12.05 - Jurgen Schmidt
//

// PIN_A0   hdr
// PIN_A1   hdr
// PIN_A2   hdr
// PIN_A3   hdr
// PIN_A5   hdr
//
#define BUTTON       PIN_B0   // press=low
// PIN_B1   hdr
// PIN_B2   ETH_INT
// PIN_B3   ETH_CS
// PIN_B4   EE_CS
// PIN_B5   ETH_RST
// PIN_B6   ICSP_PGC
// PIN_B7   ICSP_PGD
//
// PIN_C0   hdr
// PIN_C1   hdr
#define LED_BOARD    PIN_C2   // on board
// PIN_C3   SCK: EEPROM, ETH
// PIN_C4   SDO: EEPROM, ETH
// PIN_C5   SDI: EEPROM, ETH
// PIN_C6   RS232_IN    (hdr
// PIN_C7   RS232_OUT   (hdr)
//

//
#include <18f25j10.h>
#use delay(clock=40M, oscillator=10M)
#use rs232(baud=9600, XMIT=PIN_A1, INVERT)
#fuses H4_SW, NOWDT, NODEBUG


Enjoy,

Jurgen


Last edited by jgschmidt on Sat Dec 27, 2008 1:13 am; edited 1 time in total
Torello



Joined: 29 Sep 2006
Posts: 110

View user's profile Send private message

PostPosted: Sun Dec 21, 2008 6:29 am     Reply with quote

Hi Jurgen,

Great work! And thanks for posting!

Regards,
Edwin.
Manel28



Joined: 06 May 2010
Posts: 33

View user's profile Send private message

PostPosted: Fri Apr 08, 2011 5:06 am     Reply with quote

Does it mean that if I make:

if STACK_USE_MAC
#define MAC_TX_BUFFER_SIZE 1024
#define MAC_TX_BUFFER_COUNT 3

will I have more Rx memory to receive bytes?
I think the enc28j60 has 8K, in this case 3K for reception.

I would like to change the RX buffer size but I'm not quite sure if thats ok.
drx2k



Joined: 31 Mar 2010
Posts: 10

View user's profile Send private message

PostPosted: Wed May 04, 2011 7:40 am     Reply with quote

How to add new hardware profile?

For example, I have an enc28j60 module (Olimex enc28j60-h) and PIC18F2550 or PIC18F4550 (non ethernet development board). What hardware profile should I use?
aytacgul



Joined: 16 Jul 2012
Posts: 2

View user's profile Send private message

PostPosted: Mon Jul 16, 2012 5:59 am     Reply with quote

I want to use WIZnet WIZ820io Module with PIC Microcontrollers. SPI Interface TCP/IP Stack Module. This Module Smaller and faster than Olimex module.

http://wiznet.co.kr/sub_modules/en/product/Product_Detail.asp?cate1=5&cate2=42&cate3=0&pid=1161


http://www.signal.com.tr/arananurun.php?urun=WIZ820io&&id=143383
jgschmidt



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

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

PostPosted: Mon Jul 16, 2012 9:13 am     Reply with quote

Your first web link references some Arduino examples. You could probably convert those to CCS.
_________________
J├╝rgen
www.jgscraft.com
aytacgul



Joined: 16 Jul 2012
Posts: 2

View user's profile Send private message

PostPosted: Tue Jul 17, 2012 5:19 am     Reply with quote

How can i do?

CPP File
Code:

Copyright (c) 2010 by Cristian Maglie <c.maglie@bug.st>

http://code.google.com/p/arduino/source/browse/trunk/libraries/Ethernet/utility/w5100.cpp?r=1042


+++++++++++++++++++++++
Code deleted. Link added.

Arduino is off topic for CCS forum.
No Arduino questions on CCS forum !
Use Arduino forum !

- Forum Moderator
+++++++++++++++++++++++
freesat



Joined: 08 Feb 2011
Posts: 32

View user's profile Send private message

I'm doing something wrong or ccs is very slow with tcp/ip?
PostPosted: Mon Aug 20, 2012 11:13 pm     Reply with quote

Hi jgschmidt, I have another Olimex board (PIC MAXI WEB), and following your mods, I can get it to work with (ex_st_webserver example), but its too slow with CCS code and very much faster with Microchip c18 code.

Have you experienced this too? Or does your board work faster with ccs code ?

I have used on C18 (real time response for leds, relays and lcd) TCP/IP Stack 5.31, and on CCS 4.134 (needs at least 5 seconds for response from leds, relays and lcd) TCP/IP Stack 10/25/06 in synch with Microchip's V3.75 stack.

Response differences are with same board, but C18 web pages are stored on external eeprom and CCS web pages on internal flash.

Any comments will be great.

Best regards.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> Code Library 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