SlideShare a Scribd company logo
1 of 16
Download to read offline
AVR HOW-TO GUIDE
Interfacing SPI-Ethernet with
AVR Slicker
Join the Technical Community Today!
http://www.pantechsolutions.net
Contents at a Glance
AVR Slicker Board............................................................3
SPI (Serial Peripheral Interface)........................................3
Ethernet ..........................................................................4
The ENC28J60 Ethernet Controller ...................................4
Interfacing SPI-Ethernet...................................................5
Interfacing SPI-Ethernet with AVR....................................7
Pin Assignment with AVR Slicker......................................7
Circuit Diagram to Interface SPI-Ethernet with AVR..........8
Source Code ..................................................................10
C Program to interface Ethernet with AVR .....................10
Testing the SPI-Ethernet with AVR Slicker ......................12
General Information......................................................14
Join the Technical Community Today!
http://www.pantechsolutions.net
AVR Slicker Board
The AVR Slicker board is specifically designed to help
students to master the required skills in the area of
embedded systems. The kit is designed in such way that all
the possible features of the microcontroller will be easily
used by the students. The kit supports In-system
programming (ISP) which is done through Parallel/Printer
port.
ATMEL’s AVR At ega8 , AVR Sli ker Kit is proposed
to smooth the progress of developing and debugging of
various designs encompassing of High speed 8-bit
Microcontrollers.
SPI (Serial Peripheral Interface)
Serial Peripheral Interface (SPI) is a synchronous serial
data protocol used by microcontrollers for communicating
with one or more peripheral devices quickly over short
Join the Technical Community Today!
http://www.pantechsolutions.net
distances. It can also be used for communication between
two microcontrollers.
Ethernet
Ethernet is the most widely-installed local area network
(LAN) technology. An Ethernet LAN typically uses coaxial
cable or special grades of twisted pair wires. Ethernet is also
used in wireless LANs. The most commonly installed
Ethernet systems are called 10BASE-T and provide
transmission speeds up to 10 Mbps. Devices are connected
to the cable and compete for access using a Carrier Sense
Multiple Access with Collision Detection (CSMA/CD)
protocol.
The ENC28J60 Ethernet Controller
Mi ro hip’s ENC 8J 0 o troller is a 8-pin, 10BASE-T
standalone Ethernet Controller, with on board MAC & PHY,
8 Kbytes of Buffer RAM and an SPI serial interface used as
an Ethernet network interface for any microcontroller
Join the Technical Community Today!
http://www.pantechsolutions.net
equipped with SPI interface. So the microcontroller can
then control remotely any hardware.
Interfacing SPI-Ethernet
Fig. 1 shows how to interface the SPI-Ethernet to
microcontroller. With an SPI connection there is always one
master device (usually a microcontroller) which controls the
peripheral devices. Typically there are three lines common
to all the devices,
Master In Slave Out (MISO) - The Slave line for
sending data to the master,
Master Out Slave In (MOSI) - The Master line for
sending data to the peripherals,
Serial Clock (SCK) - The clock pulses which
synchronize data transmission generated by the
master, and
Slave Select pin - the pin on each device that the
master can use to enable and disable specific
devices. When a device's Slave Select pin is low, it
Join the Technical Community Today!
http://www.pantechsolutions.net
communicates with the master. When it's high, it
ignores the master.
This allows you to have multiple SPI devices sharing the
same MISO, MOSI, and CLK lines.
Fig. 1 Interfacing SPI-Ethernet to Microcontroller
The Ethernet buffer contains transmit and receive
memory used by the Ethernet controller. The entire buffer
is 8 Kbytes, divided into separate receive and transmit
buffer spaces. The sizes and locations of transmit and
Join the Technical Community Today!
http://www.pantechsolutions.net
receive memory are fully programmable by the host
controller using the SPI interface. Any space within the 8-
Kbyte memory, which is not programmed as part of the
receive FIFO buffer, is considered to be the transmit buffer.
Interfacing SPI-Ethernet with AVR
In SPI, the clock signal is controlled by the master
device AVR Slicker Board. All data is clocked in and out using
this pin. These lines need to be connected to the relevant
pins on the AVR Slicker Board. Any unused GIO pin can be
used for CS, instead pull this pin high. The ENC28J60
requires a single per packet control byte to precede the
packet for transmission to Microcontroller. An IP address is
used to access the Ethernet control. The ENC28J60 SPI
connections with AVR have four I/O lines required.
Pin Assignment with AVR Slicker
Join the Technical Community Today!
http://www.pantechsolutions.net
]
Circuit Diagram to Interface SPI-Ethernet with AVR
Join the Technical Community Today!
http://www.pantechsolutions.net
Join the Technical Community Today!
http://www.pantechsolutions.net
Source Code
The Interfacing UART with AVR program is very simple
and straight forward, which controls the LED & Switches in
AVR Slicker Board from Ethernet through SPI. In C programs
are written in MikroC Compiler software. When we select
LED or Switch in Internet Explorer by using IP address then
the output is enabled in AVR controller.
C Program to interface Ethernet with AVR
***************************************************************************************
Title : Program to control LED & Switches from Ethernet using SPI
***************************************************************************************
#include "__EthEnc28j60.h"
void main()
{
// set PORTC as input
DDRC = 0;
// set PORTD as output
DDRD = 0xFF;
Join the Technical Community Today!
http://www.pantechsolutions.net
/*
* starts ENC28J60 with :
* reset bit on PB4
* CS bit on PB5
* my MAC & IP address
* full duplex
*/
SPI1_Init();
SPI_Ethernet_Init(myMacAddr, myIpAddr, Spi_Ethernet_FULLDUPLEX) ;
// dhcp will not be used here, so use preconfigured
addresses
//SPI_Ethernet_confNetwork(ipMask, gwIpAddr, dnsIpAddr)
;
while(1) // do forever
{
/*
* if necessary, test the return value to get
error code
*/
SPI_Ethernet_doPacket() ;
// process incoming Ethernet packets
/*
* add your stuff here if needed
* Spi_Ethernet_doPacket() must be called as
often as possible
* otherwise packets could be lost
*/
}
}
Join the Technical Community Today!
http://www.pantechsolutions.net
To compile the above C code you need the MikroC for
AVR software. The software has it’s ow IDE a d uilt-in
AVR gcc- Compiler. They must be properly installed and a
project with correct settings must be created in order to
compile the code. To compile the above code, the C file
must be added to the project.
In MikroC for AVR software, you can develop or debug
the project without any hardware setup. You must compile
the code for generating HEX file. In debugging Mode, you
want to check the port output without microcontroller
Board.
The MikroC for AVR software is used to download the
hex file into your microcontroller through Parallel port.
Testing the SPI-Ethernet with AVR Slicker
Give +12V power supply to AVR Slicker Board; the SPI-
Ethernet is connected with AVR Slicker Board. Connect your
board to a hub with a straight cable. LEDA should now turn
on with LEDB still blinking. LEDA ON means that the adapter
Join the Technical Community Today!
http://www.pantechsolutions.net
is correctly linked to the network. The network link LED of
the other side hub should also turn on.
Open the Internet Explorer window and give the IP
address. If the entire connections are connected correctly,
then the IP address display the LED, switch levels.
Now you can control the input & output port lines (LED
& switch) of AVR Slicker Board from Internet Explorer
through SPI - Ethernet. If you are not reading any output
from LED, then you just check the jumper connections &
check the LED is working.
If you are not controlled the I/O port lines of AVR
Slicker Board from Internet Explorer, then you just check
the IP address & Ethernet connections. Otherwise you just
check the code with debugging mode in MikroC for AVR
Software. If you want to see more details about debugging
just see the videos in below link.
 How to Create & Debug a Project in MikroC for
AVR Software.
Join the Technical Community Today!
http://www.pantechsolutions.net
General Information
For proper working use the components of exact values
as shown in Circuit file. Wherever possible use new
components.
Solder everything in a clean way. A major problem
arises due to improper soldering, solder jumps and
loose joints.
Use the exact value crystal shown in schematic.
The straight cable only used between AVR Slicker Board
hub & the network cable hub.
Don't plug the ENC28J60 in its socket, then power to
the board and verify the 3.3V power supply on each pin
of the ENC.
More instructions are available in following articles,
 User Manual of AVR Slicker Board.
 Tutorial of how to create & Debug a project in
MikroC for AVR.
Join the Technical Community Today!
http://www.pantechsolutions.net
Pantech solutions creates information packed technical
documents like this one every month. And our website is a rich
and trusted resource used by a vibrant online community of
more than 1,00,000 members from organization of all shapes
and sizes.
Did you enjoy the read?
Join the Technical Community Today!
http://www.pantechsolutions.net
What do we sell?
Our products range from Various Microcontroller
development boards, DSP Boards, FPGA/CPLD boards,
Communication Kits, Power electronics, Basic electronics,
Robotics, Sensors, Electronic components and much more . Our
goal is to make finding the parts and information you need
easier and affordable so you can create awesome projects and
training from Basic to Cutting edge technology.

More Related Content

Similar to AVR HOW-TO GUIDE Interfacing SPI-Ethernet With AVR Slicker Contents At A Glance

Developing an avr microcontroller system
Developing an avr microcontroller systemDeveloping an avr microcontroller system
Developing an avr microcontroller systemnugnugmacmac
 
IRJET- Wi-Fi Control First Person View Robot (FPV)
IRJET- Wi-Fi Control First Person View Robot (FPV)IRJET- Wi-Fi Control First Person View Robot (FPV)
IRJET- Wi-Fi Control First Person View Robot (FPV)IRJET Journal
 
Brain wave controlled robot
Brain wave controlled robotBrain wave controlled robot
Brain wave controlled robotRahul Wagh
 
Embedded application development
Embedded application developmentEmbedded application development
Embedded application developmentAakash Raj
 
Hands On Workshop on IoT: From Arduino to JRC Board
Hands On Workshop on IoT: From Arduino to JRC BoardHands On Workshop on IoT: From Arduino to JRC Board
Hands On Workshop on IoT: From Arduino to JRC BoardRedwan Ferdous
 
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdf
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdfAdvanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdf
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdfWiseNaeem
 
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdf
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdfAdvanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdf
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdfWiseNaeem
 
Michael Ledford Fall 2014 Resume
Michael Ledford Fall 2014 ResumeMichael Ledford Fall 2014 Resume
Michael Ledford Fall 2014 ResumeMichael Ledford
 
Rodrigo Almeida - Microkernel development from project to implementation
Rodrigo Almeida - Microkernel development from project to implementationRodrigo Almeida - Microkernel development from project to implementation
Rodrigo Almeida - Microkernel development from project to implementationFelipe Prado
 
Tutorial on avr atmega8 microcontroller, architecture and its applications
Tutorial on avr atmega8 microcontroller, architecture and its applicationsTutorial on avr atmega8 microcontroller, architecture and its applications
Tutorial on avr atmega8 microcontroller, architecture and its applicationsEdgefxkits & Solutions
 
Bluetooth based home automation system
Bluetooth based home automation systemBluetooth based home automation system
Bluetooth based home automation systemVeer Singh shakya
 
Networking of multiple microcontrollers
Networking of multiple microcontrollersNetworking of multiple microcontrollers
Networking of multiple microcontrollersEdgefxkits & Solutions
 
Automatic Power Factor Correction Using Arduino Uno
Automatic Power Factor Correction Using Arduino UnoAutomatic Power Factor Correction Using Arduino Uno
Automatic Power Factor Correction Using Arduino UnoVineetKumar508
 
arduino-esp32-projects.pdf
arduino-esp32-projects.pdfarduino-esp32-projects.pdf
arduino-esp32-projects.pdfDaniel Donatelli
 
AVR atmega8 microcontroller based projects list - ATMega32 AVR.pdf
AVR atmega8 microcontroller based projects list - ATMega32 AVR.pdfAVR atmega8 microcontroller based projects list - ATMega32 AVR.pdf
AVR atmega8 microcontroller based projects list - ATMega32 AVR.pdfIsmailkhan77481
 

Similar to AVR HOW-TO GUIDE Interfacing SPI-Ethernet With AVR Slicker Contents At A Glance (20)

Developing an avr microcontroller system
Developing an avr microcontroller systemDeveloping an avr microcontroller system
Developing an avr microcontroller system
 
IRJET- Wi-Fi Control First Person View Robot (FPV)
IRJET- Wi-Fi Control First Person View Robot (FPV)IRJET- Wi-Fi Control First Person View Robot (FPV)
IRJET- Wi-Fi Control First Person View Robot (FPV)
 
PIC Axe049(print34)
PIC Axe049(print34)PIC Axe049(print34)
PIC Axe049(print34)
 
Brain wave controlled robot
Brain wave controlled robotBrain wave controlled robot
Brain wave controlled robot
 
Embedded application development
Embedded application developmentEmbedded application development
Embedded application development
 
Hands On Workshop on IoT: From Arduino to JRC Board
Hands On Workshop on IoT: From Arduino to JRC BoardHands On Workshop on IoT: From Arduino to JRC Board
Hands On Workshop on IoT: From Arduino to JRC Board
 
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdf
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdfAdvanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdf
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdf
 
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdf
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdfAdvanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdf
Advanced View of Atmega Microcontroller Projects List - ATMega32 AVR.pdf
 
Michael Ledford Fall 2014 Resume
Michael Ledford Fall 2014 ResumeMichael Ledford Fall 2014 Resume
Michael Ledford Fall 2014 Resume
 
Intro to IO-Link
Intro to IO-LinkIntro to IO-Link
Intro to IO-Link
 
Rodrigo Almeida - Microkernel development from project to implementation
Rodrigo Almeida - Microkernel development from project to implementationRodrigo Almeida - Microkernel development from project to implementation
Rodrigo Almeida - Microkernel development from project to implementation
 
Tutorial on avr atmega8 microcontroller, architecture and its applications
Tutorial on avr atmega8 microcontroller, architecture and its applicationsTutorial on avr atmega8 microcontroller, architecture and its applications
Tutorial on avr atmega8 microcontroller, architecture and its applications
 
Bluetooth based home automation system
Bluetooth based home automation systemBluetooth based home automation system
Bluetooth based home automation system
 
Networking of multiple microcontrollers
Networking of multiple microcontrollersNetworking of multiple microcontrollers
Networking of multiple microcontrollers
 
Introduction of Arduino Uno
Introduction of Arduino UnoIntroduction of Arduino Uno
Introduction of Arduino Uno
 
embedded system and AVR
embedded system and AVRembedded system and AVR
embedded system and AVR
 
Atmega 16 drdo report
Atmega 16 drdo reportAtmega 16 drdo report
Atmega 16 drdo report
 
Automatic Power Factor Correction Using Arduino Uno
Automatic Power Factor Correction Using Arduino UnoAutomatic Power Factor Correction Using Arduino Uno
Automatic Power Factor Correction Using Arduino Uno
 
arduino-esp32-projects.pdf
arduino-esp32-projects.pdfarduino-esp32-projects.pdf
arduino-esp32-projects.pdf
 
AVR atmega8 microcontroller based projects list - ATMega32 AVR.pdf
AVR atmega8 microcontroller based projects list - ATMega32 AVR.pdfAVR atmega8 microcontroller based projects list - ATMega32 AVR.pdf
AVR atmega8 microcontroller based projects list - ATMega32 AVR.pdf
 

More from Scott Faria

002 Essay Example Refle. Online assignment writing service.
002 Essay Example Refle. Online assignment writing service.002 Essay Example Refle. Online assignment writing service.
002 Essay Example Refle. Online assignment writing service.Scott Faria
 
How To Write A Proper Observation Essay - Adair
How To Write A Proper Observation Essay - AdairHow To Write A Proper Observation Essay - Adair
How To Write A Proper Observation Essay - AdairScott Faria
 
Get Community College Essay Examples Tips - Es. Online assignment writing ser...
Get Community College Essay Examples Tips - Es. Online assignment writing ser...Get Community College Essay Examples Tips - Es. Online assignment writing ser...
Get Community College Essay Examples Tips - Es. Online assignment writing ser...Scott Faria
 
Ocean Writing Paper Writing Paper, Kindergarte
Ocean Writing Paper Writing Paper, KindergarteOcean Writing Paper Writing Paper, Kindergarte
Ocean Writing Paper Writing Paper, KindergarteScott Faria
 
CompareContrast Essay Outline Essay Outline The
CompareContrast Essay Outline Essay Outline TheCompareContrast Essay Outline Essay Outline The
CompareContrast Essay Outline Essay Outline TheScott Faria
 
Good Essay Guide Essay Writing Skills, Writing Lesso
Good Essay Guide Essay Writing Skills, Writing LessoGood Essay Guide Essay Writing Skills, Writing Lesso
Good Essay Guide Essay Writing Skills, Writing LessoScott Faria
 
Literature Review Chicago Style Sample Welcome T
Literature Review Chicago Style Sample Welcome TLiterature Review Chicago Style Sample Welcome T
Literature Review Chicago Style Sample Welcome TScott Faria
 
100Th Day Writing Paper With Border And 3-Ruled Lines -
100Th Day Writing Paper With Border And 3-Ruled Lines -100Th Day Writing Paper With Border And 3-Ruled Lines -
100Th Day Writing Paper With Border And 3-Ruled Lines -Scott Faria
 
014 Essay Example Descriptive Person Writing
014 Essay Example Descriptive Person Writing014 Essay Example Descriptive Person Writing
014 Essay Example Descriptive Person WritingScott Faria
 
6 Essay Writing Tips For Scoring Good Grades
6 Essay Writing Tips For Scoring Good Grades6 Essay Writing Tips For Scoring Good Grades
6 Essay Writing Tips For Scoring Good GradesScott Faria
 
Scholarship Essay Graduate Program Essay Examples
Scholarship Essay Graduate Program Essay ExamplesScholarship Essay Graduate Program Essay Examples
Scholarship Essay Graduate Program Essay ExamplesScott Faria
 
Writing A Strong Introduction To A Descriptive Essay
Writing A Strong Introduction To A Descriptive EssayWriting A Strong Introduction To A Descriptive Essay
Writing A Strong Introduction To A Descriptive EssayScott Faria
 
Abstract Writing For Research Papers. How To Make Your
Abstract Writing For Research Papers. How To Make YourAbstract Writing For Research Papers. How To Make Your
Abstract Writing For Research Papers. How To Make YourScott Faria
 
Essay On Child Labour In English How To Write Essay On Child Labour
Essay On Child Labour In English How To Write Essay On Child LabourEssay On Child Labour In English How To Write Essay On Child Labour
Essay On Child Labour In English How To Write Essay On Child LabourScott Faria
 
Short Essay College Apa Format Paper Does Apa F
Short Essay College Apa Format Paper Does Apa FShort Essay College Apa Format Paper Does Apa F
Short Essay College Apa Format Paper Does Apa FScott Faria
 
Pustakachi Atmakatha In Marathi Plz Help - Brainly.In
Pustakachi Atmakatha In Marathi Plz Help - Brainly.InPustakachi Atmakatha In Marathi Plz Help - Brainly.In
Pustakachi Atmakatha In Marathi Plz Help - Brainly.InScott Faria
 
How To Write An Intro Paragraph For A Synthesis Essay - Airey Pen
How To Write An Intro Paragraph For A Synthesis Essay - Airey PenHow To Write An Intro Paragraph For A Synthesis Essay - Airey Pen
How To Write An Intro Paragraph For A Synthesis Essay - Airey PenScott Faria
 
(PDF) Guide To Writing Philosophy Essays Rhod
(PDF) Guide To Writing Philosophy Essays Rhod(PDF) Guide To Writing Philosophy Essays Rhod
(PDF) Guide To Writing Philosophy Essays RhodScott Faria
 
Social Issues Essay By Kelvin. Online assignment writing service.
Social Issues Essay By Kelvin. Online assignment writing service.Social Issues Essay By Kelvin. Online assignment writing service.
Social Issues Essay By Kelvin. Online assignment writing service.Scott Faria
 
How To Write A College Essay Step By Step Guid
How To Write A College Essay Step By Step GuidHow To Write A College Essay Step By Step Guid
How To Write A College Essay Step By Step GuidScott Faria
 

More from Scott Faria (20)

002 Essay Example Refle. Online assignment writing service.
002 Essay Example Refle. Online assignment writing service.002 Essay Example Refle. Online assignment writing service.
002 Essay Example Refle. Online assignment writing service.
 
How To Write A Proper Observation Essay - Adair
How To Write A Proper Observation Essay - AdairHow To Write A Proper Observation Essay - Adair
How To Write A Proper Observation Essay - Adair
 
Get Community College Essay Examples Tips - Es. Online assignment writing ser...
Get Community College Essay Examples Tips - Es. Online assignment writing ser...Get Community College Essay Examples Tips - Es. Online assignment writing ser...
Get Community College Essay Examples Tips - Es. Online assignment writing ser...
 
Ocean Writing Paper Writing Paper, Kindergarte
Ocean Writing Paper Writing Paper, KindergarteOcean Writing Paper Writing Paper, Kindergarte
Ocean Writing Paper Writing Paper, Kindergarte
 
CompareContrast Essay Outline Essay Outline The
CompareContrast Essay Outline Essay Outline TheCompareContrast Essay Outline Essay Outline The
CompareContrast Essay Outline Essay Outline The
 
Good Essay Guide Essay Writing Skills, Writing Lesso
Good Essay Guide Essay Writing Skills, Writing LessoGood Essay Guide Essay Writing Skills, Writing Lesso
Good Essay Guide Essay Writing Skills, Writing Lesso
 
Literature Review Chicago Style Sample Welcome T
Literature Review Chicago Style Sample Welcome TLiterature Review Chicago Style Sample Welcome T
Literature Review Chicago Style Sample Welcome T
 
100Th Day Writing Paper With Border And 3-Ruled Lines -
100Th Day Writing Paper With Border And 3-Ruled Lines -100Th Day Writing Paper With Border And 3-Ruled Lines -
100Th Day Writing Paper With Border And 3-Ruled Lines -
 
014 Essay Example Descriptive Person Writing
014 Essay Example Descriptive Person Writing014 Essay Example Descriptive Person Writing
014 Essay Example Descriptive Person Writing
 
6 Essay Writing Tips For Scoring Good Grades
6 Essay Writing Tips For Scoring Good Grades6 Essay Writing Tips For Scoring Good Grades
6 Essay Writing Tips For Scoring Good Grades
 
Scholarship Essay Graduate Program Essay Examples
Scholarship Essay Graduate Program Essay ExamplesScholarship Essay Graduate Program Essay Examples
Scholarship Essay Graduate Program Essay Examples
 
Writing A Strong Introduction To A Descriptive Essay
Writing A Strong Introduction To A Descriptive EssayWriting A Strong Introduction To A Descriptive Essay
Writing A Strong Introduction To A Descriptive Essay
 
Abstract Writing For Research Papers. How To Make Your
Abstract Writing For Research Papers. How To Make YourAbstract Writing For Research Papers. How To Make Your
Abstract Writing For Research Papers. How To Make Your
 
Essay On Child Labour In English How To Write Essay On Child Labour
Essay On Child Labour In English How To Write Essay On Child LabourEssay On Child Labour In English How To Write Essay On Child Labour
Essay On Child Labour In English How To Write Essay On Child Labour
 
Short Essay College Apa Format Paper Does Apa F
Short Essay College Apa Format Paper Does Apa FShort Essay College Apa Format Paper Does Apa F
Short Essay College Apa Format Paper Does Apa F
 
Pustakachi Atmakatha In Marathi Plz Help - Brainly.In
Pustakachi Atmakatha In Marathi Plz Help - Brainly.InPustakachi Atmakatha In Marathi Plz Help - Brainly.In
Pustakachi Atmakatha In Marathi Plz Help - Brainly.In
 
How To Write An Intro Paragraph For A Synthesis Essay - Airey Pen
How To Write An Intro Paragraph For A Synthesis Essay - Airey PenHow To Write An Intro Paragraph For A Synthesis Essay - Airey Pen
How To Write An Intro Paragraph For A Synthesis Essay - Airey Pen
 
(PDF) Guide To Writing Philosophy Essays Rhod
(PDF) Guide To Writing Philosophy Essays Rhod(PDF) Guide To Writing Philosophy Essays Rhod
(PDF) Guide To Writing Philosophy Essays Rhod
 
Social Issues Essay By Kelvin. Online assignment writing service.
Social Issues Essay By Kelvin. Online assignment writing service.Social Issues Essay By Kelvin. Online assignment writing service.
Social Issues Essay By Kelvin. Online assignment writing service.
 
How To Write A College Essay Step By Step Guid
How To Write A College Essay Step By Step GuidHow To Write A College Essay Step By Step Guid
How To Write A College Essay Step By Step Guid
 

Recently uploaded

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 

Recently uploaded (20)

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 

AVR HOW-TO GUIDE Interfacing SPI-Ethernet With AVR Slicker Contents At A Glance

  • 1. AVR HOW-TO GUIDE Interfacing SPI-Ethernet with AVR Slicker
  • 2. Join the Technical Community Today! http://www.pantechsolutions.net Contents at a Glance AVR Slicker Board............................................................3 SPI (Serial Peripheral Interface)........................................3 Ethernet ..........................................................................4 The ENC28J60 Ethernet Controller ...................................4 Interfacing SPI-Ethernet...................................................5 Interfacing SPI-Ethernet with AVR....................................7 Pin Assignment with AVR Slicker......................................7 Circuit Diagram to Interface SPI-Ethernet with AVR..........8 Source Code ..................................................................10 C Program to interface Ethernet with AVR .....................10 Testing the SPI-Ethernet with AVR Slicker ......................12 General Information......................................................14
  • 3. Join the Technical Community Today! http://www.pantechsolutions.net AVR Slicker Board The AVR Slicker board is specifically designed to help students to master the required skills in the area of embedded systems. The kit is designed in such way that all the possible features of the microcontroller will be easily used by the students. The kit supports In-system programming (ISP) which is done through Parallel/Printer port. ATMEL’s AVR At ega8 , AVR Sli ker Kit is proposed to smooth the progress of developing and debugging of various designs encompassing of High speed 8-bit Microcontrollers. SPI (Serial Peripheral Interface) Serial Peripheral Interface (SPI) is a synchronous serial data protocol used by microcontrollers for communicating with one or more peripheral devices quickly over short
  • 4. Join the Technical Community Today! http://www.pantechsolutions.net distances. It can also be used for communication between two microcontrollers. Ethernet Ethernet is the most widely-installed local area network (LAN) technology. An Ethernet LAN typically uses coaxial cable or special grades of twisted pair wires. Ethernet is also used in wireless LANs. The most commonly installed Ethernet systems are called 10BASE-T and provide transmission speeds up to 10 Mbps. Devices are connected to the cable and compete for access using a Carrier Sense Multiple Access with Collision Detection (CSMA/CD) protocol. The ENC28J60 Ethernet Controller Mi ro hip’s ENC 8J 0 o troller is a 8-pin, 10BASE-T standalone Ethernet Controller, with on board MAC & PHY, 8 Kbytes of Buffer RAM and an SPI serial interface used as an Ethernet network interface for any microcontroller
  • 5. Join the Technical Community Today! http://www.pantechsolutions.net equipped with SPI interface. So the microcontroller can then control remotely any hardware. Interfacing SPI-Ethernet Fig. 1 shows how to interface the SPI-Ethernet to microcontroller. With an SPI connection there is always one master device (usually a microcontroller) which controls the peripheral devices. Typically there are three lines common to all the devices, Master In Slave Out (MISO) - The Slave line for sending data to the master, Master Out Slave In (MOSI) - The Master line for sending data to the peripherals, Serial Clock (SCK) - The clock pulses which synchronize data transmission generated by the master, and Slave Select pin - the pin on each device that the master can use to enable and disable specific devices. When a device's Slave Select pin is low, it
  • 6. Join the Technical Community Today! http://www.pantechsolutions.net communicates with the master. When it's high, it ignores the master. This allows you to have multiple SPI devices sharing the same MISO, MOSI, and CLK lines. Fig. 1 Interfacing SPI-Ethernet to Microcontroller The Ethernet buffer contains transmit and receive memory used by the Ethernet controller. The entire buffer is 8 Kbytes, divided into separate receive and transmit buffer spaces. The sizes and locations of transmit and
  • 7. Join the Technical Community Today! http://www.pantechsolutions.net receive memory are fully programmable by the host controller using the SPI interface. Any space within the 8- Kbyte memory, which is not programmed as part of the receive FIFO buffer, is considered to be the transmit buffer. Interfacing SPI-Ethernet with AVR In SPI, the clock signal is controlled by the master device AVR Slicker Board. All data is clocked in and out using this pin. These lines need to be connected to the relevant pins on the AVR Slicker Board. Any unused GIO pin can be used for CS, instead pull this pin high. The ENC28J60 requires a single per packet control byte to precede the packet for transmission to Microcontroller. An IP address is used to access the Ethernet control. The ENC28J60 SPI connections with AVR have four I/O lines required. Pin Assignment with AVR Slicker
  • 8. Join the Technical Community Today! http://www.pantechsolutions.net ] Circuit Diagram to Interface SPI-Ethernet with AVR
  • 9. Join the Technical Community Today! http://www.pantechsolutions.net
  • 10. Join the Technical Community Today! http://www.pantechsolutions.net Source Code The Interfacing UART with AVR program is very simple and straight forward, which controls the LED & Switches in AVR Slicker Board from Ethernet through SPI. In C programs are written in MikroC Compiler software. When we select LED or Switch in Internet Explorer by using IP address then the output is enabled in AVR controller. C Program to interface Ethernet with AVR *************************************************************************************** Title : Program to control LED & Switches from Ethernet using SPI *************************************************************************************** #include "__EthEnc28j60.h" void main() { // set PORTC as input DDRC = 0; // set PORTD as output DDRD = 0xFF;
  • 11. Join the Technical Community Today! http://www.pantechsolutions.net /* * starts ENC28J60 with : * reset bit on PB4 * CS bit on PB5 * my MAC & IP address * full duplex */ SPI1_Init(); SPI_Ethernet_Init(myMacAddr, myIpAddr, Spi_Ethernet_FULLDUPLEX) ; // dhcp will not be used here, so use preconfigured addresses //SPI_Ethernet_confNetwork(ipMask, gwIpAddr, dnsIpAddr) ; while(1) // do forever { /* * if necessary, test the return value to get error code */ SPI_Ethernet_doPacket() ; // process incoming Ethernet packets /* * add your stuff here if needed * Spi_Ethernet_doPacket() must be called as often as possible * otherwise packets could be lost */ } }
  • 12. Join the Technical Community Today! http://www.pantechsolutions.net To compile the above C code you need the MikroC for AVR software. The software has it’s ow IDE a d uilt-in AVR gcc- Compiler. They must be properly installed and a project with correct settings must be created in order to compile the code. To compile the above code, the C file must be added to the project. In MikroC for AVR software, you can develop or debug the project without any hardware setup. You must compile the code for generating HEX file. In debugging Mode, you want to check the port output without microcontroller Board. The MikroC for AVR software is used to download the hex file into your microcontroller through Parallel port. Testing the SPI-Ethernet with AVR Slicker Give +12V power supply to AVR Slicker Board; the SPI- Ethernet is connected with AVR Slicker Board. Connect your board to a hub with a straight cable. LEDA should now turn on with LEDB still blinking. LEDA ON means that the adapter
  • 13. Join the Technical Community Today! http://www.pantechsolutions.net is correctly linked to the network. The network link LED of the other side hub should also turn on. Open the Internet Explorer window and give the IP address. If the entire connections are connected correctly, then the IP address display the LED, switch levels. Now you can control the input & output port lines (LED & switch) of AVR Slicker Board from Internet Explorer through SPI - Ethernet. If you are not reading any output from LED, then you just check the jumper connections & check the LED is working. If you are not controlled the I/O port lines of AVR Slicker Board from Internet Explorer, then you just check the IP address & Ethernet connections. Otherwise you just check the code with debugging mode in MikroC for AVR Software. If you want to see more details about debugging just see the videos in below link.  How to Create & Debug a Project in MikroC for AVR Software.
  • 14. Join the Technical Community Today! http://www.pantechsolutions.net General Information For proper working use the components of exact values as shown in Circuit file. Wherever possible use new components. Solder everything in a clean way. A major problem arises due to improper soldering, solder jumps and loose joints. Use the exact value crystal shown in schematic. The straight cable only used between AVR Slicker Board hub & the network cable hub. Don't plug the ENC28J60 in its socket, then power to the board and verify the 3.3V power supply on each pin of the ENC. More instructions are available in following articles,  User Manual of AVR Slicker Board.  Tutorial of how to create & Debug a project in MikroC for AVR.
  • 15. Join the Technical Community Today! http://www.pantechsolutions.net Pantech solutions creates information packed technical documents like this one every month. And our website is a rich and trusted resource used by a vibrant online community of more than 1,00,000 members from organization of all shapes and sizes. Did you enjoy the read?
  • 16. Join the Technical Community Today! http://www.pantechsolutions.net What do we sell? Our products range from Various Microcontroller development boards, DSP Boards, FPGA/CPLD boards, Communication Kits, Power electronics, Basic electronics, Robotics, Sensors, Electronic components and much more . Our goal is to make finding the parts and information you need easier and affordable so you can create awesome projects and training from Basic to Cutting edge technology.