Using the Arduino Ethernet shield with AMICUS18 (Part 1~4)
OpenSourceHardware/ETC 2015. 2. 24. 15:39Using the Arduino Ethernet shield with AMICUS18 (Part 1~4)
by HenrikOlsson
저자는 http://www.picbasic.uk 의 Forum에 적극적으로 활동하고 있으며, picbasic의 Forum에서 PIC 기반의 AMICUS18 Open source hardware board에 Arduino Ethernet Shield를 사용하는 방법을 공유하였다. pisbasic에서 그의 Forum 내용을 총 4회 걸쳐 기사화 하였다.
AMICUS18 board
PIC 기반의 Arduino Comapatible board로 Crownhill’s Proton BASIC 언어의 개발환경을 제공한다.
Part 1
Part 1에서는 Arduino Ethernet Board를 AMICU18 Board에 연결하기 위해 SPI 신호 핀을 연결하는 방법을 설명한다.
- AMICUS18 board는 ICSP HEADER가 없으므로, SD 카드와 Ehternet을 사용하기 위해 Ethernet Shield를 수정하고 연결하는 방법을 설명한다.
Part 2
Part 2에서는 PIC MCU의 UART 및 SPI Interface 제어를 위한 코드와 W5100 Memory Map 정의 파일을 설명한다.
Code
' By default the AMICUS18 board uses the PIC18F25K20, make sure to ' set up MCSP or whatever IDE is being used to compile for the ' correct device. DEFINE OSC 64 DEFINE LOADER_USED 1 ' We're using a bootloader. DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1 DEFINE HSER_CLROERR 1 ' Clear overflow automatically DEFINE HSER_SPBRG 138 ' 115200 Baud @ 64MHz, -0,08% SPBRGH = 0 BAUDCON.3 = 1 ' Enable 16 bit baudrate generator TRISC = %10010111 ' RC7: USART RX ' RC6: USART TX ' RC5: ETHERNET SPI Data out (SDO/MOSI) ' RC4: ETHERNET SPI Data in (SDI/MISO) ' RC3: ETHERNET SPI clock (SCK) set to INPUT according to datasheet.... ' RC2: N/U - currently ' RC2: N/U - currently ' RC1: N/U - currently TRISB = %11011011 ' RB7: N/U - currently ' RB6: N/U - currently ' RB5: ETHERNET Chip select line to W5100 ' RB4: N/U - currently ' RB3: N/U - currently ' RB2: ETHERNET Chip select line to SD-Card ' RB1: N/U and can not be used with the Ethernet shield ' RB0: ETHERNET Interrupt pin from W5100
Part 3
Part3에서는 WIZnet W5100 Interface Routine code를 작성하고, 이를 이용하여 Network Information을 설정 후 Ping test를 통해 W5100 Internet 통신을 확인한다.
- Ping Test
Part 4
Part4에서는 WIZnet W5100 Internet 송수신을 위한 Routine을 작성하고 이를 이용하여, Web Client의 Request Message를 UART 출력을 통해 보여준다.
- HTTP Request
MidnightCow
위즈네트 칩(W5300, W5200, W7100, W7500) 개발자