Olimex PIC-WEB User guide

PIC-WEB revision C development board
User's Manual
All boards produced by Olimex are ROHS compliant
Document revision D, April 2014
Copyright(c) 2014, OLIMEX Ltd, All rights reserved
Page 1 of 36
INTRODUCTION
PIC-WEB is a compact (65x60 mm) board which is supported by Microchip’s open source TCP-IP stack AN833. The board is designed with 64-pin high-performance, 1 Mbit Flash microcontroller with Ethernet - PIC18F67J60 and supports: SLIP, ARP, IP, ICMP, TCP, UDP, HTTP, DHCP, FTP. The Microchip stack is written very modular and flexible and you can enable or disable modules and supports dynamic web pages which give you the possibility to control all PIC resources remotely via FTP, HTTP, UDP, TCP etc. With this board you can implement web and ftp server, send e-mails and almost everything what the big servers do. The on board 1Mbit serial flash is available for data storage.
This board is designed to have Web page of no more than 128 kB. If you want a lot of images in your application you can also host them on other server visible on the network where you have the PIC-WEB connected. The potential of the board is to generate a fluid communication between some specific sensors or actuators across a TCP/IP net including the controls of it.
The Microchip stack is an open source library, which is possible to modify and compile at any time. But you will probably need to modify it to your own needs. The board comes with an implemented WEB server and a web page that let you controls some of the features of the board. In this manual we’ll learn about how to compile the TCP/IP stack to use it over the platform, the needed software, how to use the pre loaded web page, and how to upload your own web pages in the board.
This manual requires Microsoft Windows© OS because several software units used here are Windows compatible only.
BOARD FEATURES
PIC18F67J60 microcontroller
1Mbit on board serial flash for web pages storage
ICSP/ICD mini connector for programming and debugging with PIC-ICD2, PIC-
ICD2-POCKET and PIC-ICD2-TINY.
Reset button
User event button
Analogue trimmer potentiometer
Thermistor for temperature monitoring
RS232 driver and connector
Complete web server and TCP-IP stack support as per Microchip's open source
TCP-IP stack
Power plug-in jack for +9 to +12 VDC power supply
Voltage regulator +3.3V and filtering capacitors
status LED
UEXT connector
Extension header to connect to other boards
PCB: FR-4, 1.5 mm (0,062"), solder mask, silkscreen component print
Dimensions (60x65)mm ~ (2.36x2.55)"
Page 2 of 36
ELECTROSTATIC WARNING
The PIC-WEB board is shipped in protective anti-static packaging. The board must not be subject to high electrostatic potentials. General practice for working with static sensitive devices should be applied when working with this board.
BOARD USE REQUIREMENTS
Cables: Depends on the used programming/debugging tool. It could be 1.8 meter USB A-B cable to connect PIC-ICD2, PIC-ICD2-POCKET or PIC-KIT3 to USB host on PC or Serial DB9 cable in case of PIC-ICD2-TINY or other programming/debugging tools. You will need a serial cable if not for programming, than for configuring the board. You will also need a Crossover Ethernet cable.
Note: PIC-KIT3 is recommended for new designs since PIC-ICD2 programmers are not supported in Microchip's MPLAB X IDE. If you don't mind using MPLAB 8.xx then PIC­ICD2 is also a good choice.
Hardware: Programmer/Debugger – most of Olimex programmers are applicable, for example PIC-ICD2, PIC-ICD2-POCKET, PIC-ICD2-TINY, PIC-Kit3 or other compatible programming/debugging tool.
For programming PIC-WEB Rev. C, you will also need PIC-ICSP connector.
!!!Warning!!! When you want to program this microcontroller with PIC-ICD2, PIC-ICD2­POCKET or PIC-ICD2-TINY, before connecting the programmer to your target board, you should first connect the programmer to your computer and open MPLAB. There, first from menu Configure – Select Device – choose the microcontroller you are about to program, then from menu Programmer – Select Programmer – choose MPLAB ICD 2, wait while MPLAB is downloading operation system, and after ICD2 is connected – check in menu Programmer – Settings – Power – there is option – Power target circuit from MPLAB ICD 2 – this option should be forbidden, you could not select it. Now it is safe to connect the programmer to your target board.
Software: PIC-WEB is tested with MPLAB IDE v.8.92 + C18 compiler 3.44 Free Standart EVAL Version. The latest modified stack version we tested the board with is
TCP/IP stack 5.42 (www.microchip.com). It is possible that the stack might not function properly if used with later versions of MPLAB IDE. You will also need a terminal program configured at 19 200 bps, 8N1 and XON/XOFF flow control (it's described below).
Page 3 of 36
PROCESSOR FEATURES
PIC-WEB board uses CPU PIC18F67J60 from Microchip with these features:
Operating Frequency – DC – 41.67 MHz
Flash program memory (bytes) – 128k
Flash program memory (Instructions) – 65532
SRAM data memory (bytes) – 3808
Interrupt Sources – 26
Ethernet TX/RX Buffer (bytes) – 8192
I/O Ports – A, B, C, D, E, F, G
I/O Pins – 39
10-Bit A/D (ch) – 11
Capture/Compare/PWM Modules – 2
Enhanced Capture/Compare/PWM Modules – 3
Serial Communications – MSSP (1), Enhanced USART (1)
SPI
Master I2C™
Comparators – 2
Timers 8/16-Bit – 2/3
Resets (and Delays) - POR, BOR, RESET Instruction, Stack Full, Stack Underflow,
MCLR , WDT (PWRT, OST)
Instruction Set – 75 Instructions, 83 with Extended Instruction Set Enabled
Ethernet Features:
IEEE 802.3 compatible Ethernet Controller
Integrated MAC and 10Base-T PHY
8-Kbyte Transmit/Receive Packet Buffer SRAM
Supports one 10Base-T Port with Automatic Polarity Detection and Correction
Programmable Automatic Retransmit on Collision
Programmable Padding and CRC Generation
Programmable Automatic Rejection of Erroneous Packets
Activity Outputs for 2 LED Indicators
Buffer:
Configurable transmit/receive buffer size
Hardware-managed circular receive FIFO
Byte-wide random and sequential access
Internal DMA for fast memory copying
Hardware assisted checksum calculation for various protocols
Page 4 of 36
MAC:
Support for Unicast, Multicast and Broadcast packets
Programmable Pattern Match of up to 64 bytes within packet at user-defined
offset
Programmable wake-up on multiple packet formats
PHY:
Wave shaping output filter
Loopback mode
Flexible Oscillator Structure:
Selectable System Clock derived from single 25 MHz external source:
2.78 to 41.67 MHz
Internal 31 kHz Oscillator
Secondary Oscillator using Timer1 @ 32 kHz
Fail-Safe Clock Monitor:
Allows for safe shutdown if oscillator stops
Two-Speed Oscillator Start-up
Peripheral Highlights:
High-Current Sink/Source: 25 mA/25 mA on PORTB and PORTC
Five Timer modules (Timer0 to Timer4)
Four External Interrupt pins
Two Capture/Compare/PWM (CCP) modules
Three Enhanced Capture/Compare/PWM (ECCP) modules:
One, two or four PWM outputs
Selectable polarity
Programmable dead time
Auto-shutdown and auto-restart
Up to two Master Synchronous Serial Port (MSSP) modules supporting SPI (all 4
modes) and I2C™ Master and Slave modes
Up to two Enhanced USART modules:
Supports RS-485, RS-232 and LIN 1.2
Auto-wake-up on Start bit
Auto-Baud Detect
10-Bit, up to 16-Channel Analog-to-Digital Converter module (A/D):
Auto-acquisition capability
Conversion available during Sleep
Dual Analog Comparators with Input Multiplexing
Special Microcontroller Features:
5.5V Tolerant Inputs (digital-only pins)
Page 5 of 36
Low-Power, High-Speed CMOS Flash Technology:
Self-reprogrammable under software control
C compiler Optimized Architecture for re-entrant code
Power Management Features:
Run: CPU on, peripherals on
Idle: CPU off, peripherals on
Sleep: CPU off, peripherals off
Priority Levels for Interrupts
8x8 Single-Cycle Hardware Multiplier
Extended Watchdog Timer (WDT):
Programmable period from 4 ms to 134s
Single-Supply 3.3V In-Circuit Serial Programming™ (ICSP™) via two pins
In-Circuit Debug (ICD) with 3 Breakpoints via two pins
Operating Voltage Range of 2.35V to 3.6V (3.14V to 3.45V using Ethernet module)
On-Chip 2.5V Regulator
Page 6 of 36
BLOCK DIAGRAM
Page 7 of 36
MEMORY MAP of PIC18F67J60
Page 8 of 36
SCHEMATIC
PIC-WEB_rev_C
OLIMEX LTD, BULGARIA https://www.olimex.com
3.3VA
3.3VA
3.3VA3.3VA
10K
T1157
470uF/16V
390pF
1000uF/6.3V/8mm/ESR
20pF
20pF
220n F
100nF 100nF 100nF
100nF 100nF
100nF
10uF/6.3V
100nF
10pF
10pF
100n F
100nF
100nF
100nF
100nF
100nF
100nF
100nF
100nF
100nF
100nF
1N5819
BH34S BH34S BH34S BH34S
BH34S BH34S BH34S
BH34S
BH34S BH34S BH34S
BH34S BH34S BH34S
BH34S
BH34S
BH34S
BH34S
BH34S
BH34S
BH34S BH34S BH34S
BH34S BH34S
BH34S BH34S
BH34S
BH34S
BH34S
BH34S BH34S
BH34S BH34S
DB104(SMD)
WU06S
CL150uH/SW68
ferrite_bead
RJLD-043TC
red
YDJ-1136
RED
25MHz/5X3,2MM
3276 8/6p F
0.68
0.68
3K/1%
1.8K/1%
560
330 10K
1M
2k/1% 27 0/1%
330
560
49.9 /1%
49.9 /1%
180
180
49.9 /1%
49.9 /1%
10K
330 330
10K
200R
100K
4.7K 4.7K 33K
DB9_female
T1107A
open
open
TERMISTOR
MC34063AD_SMD_MBR
PIC18F67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SS
4
U1
#MCLR
7
AVDD
19
AVSS
20
ENVREG
18
OSC1/CLKI
39
OSC2/CLKO
40
RA0/LEDA/AN0
24
RA1/LEDB/AN1
23
RA2/AN2/VREF-
22
RA3/AN3/VREF+
21
RA4/T0CKI
28
RA5/AN4
27
RB0/INT0/FLT0
3
RB1/INT1
4
RB2/INT2
5
RB3/INT3
6
RB4/KBI0
44
RB5/KBI1
43
RB6/KBI2/PGC
42
RB7/KBI3/PGD
37
RBIAS
53
RC0/T1OSO/T13CKI
30
RC1/T1OSI/ECCP2/P2A
29
RC2/ECCP1/P1A
33
RC3/SCK1/SCL1
34
RC4/SDI1/SDA1
35
RC5/SDO1
36
RC6/TX1/CK1
31
RC7/RX1/DT1
32
RD0/P1B
60
RD1/ECCP3/P3A
59
RD2/CCP4/P3D
58
RE0/P2D
2
RE1/P2C
1
RE2/P2B
64
RE3/P3C
63
RE4/P3B
62
RE5/P1C
61
RF1/AN6/C2OUT
17
RF2/AN7/C1OUT
16
RF3/AN8
15
RF4/AN9
14
RF5/AN10/CVREF
13
RF6/AN11
12
RF7/#SS1
11
RG4/CCP5/P1D
8
TPIN+
47
TPIN-
46
TPOUT+
51
TPOUT-
50
VDD
26
VDD1
38
VDD2
57
VDDCORE/VCAP
10
VDDPLL
54
VDDRX
48
VDDTX
49
VSS
9
VSS1
25
VSS2
41
VSS3
56
VSSPLL
55
VSSRX
45
VSSTX
52
U2
C1+
1
C1-
3
C2+
4
C2-
5
R1IN
13
R1OUT
12
R2IN
8
R2OUT
9
T1IN
11
T1OUT
14
T2IN
10
T2OUT
7
V+
2
V-
6
U3
15 16
GND VCC
U3PWR
/CS/
4
/RESET/
3
/WP/
5
GND
7
SCK
2
SI
1
SO
8
VCC
6
U4
1 2 3 4 5 6 7 8 9 10
UEXT
9-12VDC
+
+
+
RJ4 5 SIDE
1:1
1:1
GND
0R
BOARD LAYOUT
POWER SUPPLY CIRCUIT
PIC-WEB can take power from two sources:
- PWR_JACK where (9-12) VDC is applied by external power source.
- EXT-20 pin VIN with the same voltage range.
The board power consumption is: about 130 mA with all peripherals and MCU running at full speed.
RESET CIRCUIT
PIC-WEB reset circuit is made with R8 (10k) pull-up, R7 (330R) serial resistor and RST button.
Although on the schematic is made provision for external reset through EXT-16 pin. Manual reset is possible by the RST button.
CLOCK CIRCUIT
Quartz crystal 25 MHz is connected to PIC18F67J60 clock in and clock out.
Quartz crystal 32.768 KHz is connected to PIC18F67J60 T1OSO and T1OSI pins for it’s internal Real Time Clock.
Page 10 of 36
JUMPER DESCRIPTION
3.3V_E
When this jumper is closed, it enables 3.3V board power supply. Default state is closed.
SCL_E
When this jumper is closed, it connects UEXT pin 5 (SCL) to UEXT pin 9 (SCK), respectively PIC18F67J60 pin 2 (RE0/P2D) to PIC18F67J60 pin 34 (RC3/SCK1/SCL1). Default state is opened.
SDA_E
When this jumper is closed, it connects UEXT pin 6 (SDA) to UEXT pin 7 (SDI), respectively PIC18F67J60 pin 1 (RE1/P2C) to PIC18F67J60 pin 35 (RC4/SDI1/SDA1). Default state is opened.
When jumpers SDA_E and SCL_E are opened, UEXT pin 5 (SCL) is connected only to PIC18F67J60 pin 2 (RE0/P2D) and UEXT pin 6 (SDA) is connected only to IC18F67J60 pin 1 (RE1/P2C), so you have to use software I2C. If you want to use hardware software, you have to close (short) jumpers SDA_E and SCL_E, but note that this will short PIC18F67J60 pin 2 (RE0/P2D) to PIC18F67J60 pin 34 (RC3/SCK1/SCL1) and PIC18F67J60 pin 1 (RE1/P2C) to PIC18F67J60 pin 35 (RC4/SDI1/SDA1).
INPUT/OUTPUT
One user button BUT – connected to PIC18F67J60 pin 3 (RB0/INT0/FLT0).
Reset button RST – connected to PIC18F67J60 pin 7 (#MKLR).
Status red LED connected to PIC18F67J60 pin 44 (RB4/KBI0).
Power supply red LED PWR – indicates that external power source is applied and board power supply is applied.
One trimmer AN_TR is connected to PIC18F67J60 pin 15 (RF3/AN8).
Page 11 of 36
Loading...
+ 25 hidden pages