MIKROE-2796

SPIChipSelect CS 3 CS RX 14 NC
SPISerialClock SCK4 SCK TX 13 NC
SPIMasterInSlaveOut MISO 5 MISO SCL 12 NC
SPIMasterOutSlaveIn MOSI 6 MOSI SDA 11 NC
Powersupply +3.3V 7 3.3V 5V 10 NC
Ground GND 8 GND GND 9 GND Ground
Onboardsettingsandindicators
Label Name Default Description
PWR PowerLED‐PowerLEDindicator.
SW1.1
ModeSelectionDIP
Switch1.1
Left
Master/Slavemodeselector,Masteratleftposition,Slaveat
rightposition
SW1.2
ModeSelectionDIP
Switch1.2
Left
10/100networkselector,10Mbpsatleftposition,100Mbpsat
rightposition
Softwaresupport
WeprovidealibraryfortheBroadR‐ReachclickonourLibStockpage,aswellasademo
application(example),developedusingMikroElektronikacompilers.Thedemocanrunon
allthemainMikroElektronikadevelopmentboards.
LibraryDescription
BroadR‐Reachclicklibrarycontainsbasicfunctionsforcontrollingtheclickboard,butalso
theadvancedfunctions,whichabstractbasicoperationstoasimplesendorreceive
functions.
Keyfunctions:
uint8_t broadr_socketOpen(uint8_t socket, uint8_t mode, uint16_t settings)-
Opens a socket in the selected mode, enabling its operation
uint8_t broadr_sendData(uint8_t socket, uint8_t * pSendData, uint16_t
bytesCount)
- Ends data from the selected socket
uint8_t broadr_receiveData(uint8_t socket, uint8_t mode, uint8_t *
pReceiveData, uint8_t * headerInformation)
- Reads received data from the selected
socket
Example Description
The application is composed of three sections :
SystemInitialization‐Initia lizespin,SPIperipheral,andloggerfunctions.
ApplicationInitialization‐Initializesthe clickdriver,setstherequirednetworkparameters
(Addresses),openssocket0inUDPmode,andsetsthedestinationaddressandportforthat
socket.
ApplicationTask‐SendsdatacontainedinthesendDataarrayandchecksifanydatahasbeen
received.Ifso,thereceiveddataisprintedonUART.ContentsofthesendDataarrayare
automaticallychangedineachiteration,sothateachsentpacketisdifferentfromtheprevious.
* Sends sendData
*/
broadr_sendData(_BROADR_SOCKET0, &sendData, 18);
/*
* Checks if data is received, and writes received data if so.
*/
if (broadr_getReceivedSize(_BROADR_SOCKET0))
{
mikrobus_logWrite("Received data:", _LOG_LINE);
broadr_receiveData(_BROADR_SOCKET0, _BROADR_MODE_UDP, &receivedData,
&receiveHeader);
mikrobus_logWrite(receivedData, _LOG_LINE);
}
else
{
mikrobus_logWrite("No data received.", _LOG_LINE);
}
/*
* Increments packet number in send data text, resets after 99.
*/
sendData[16] = sendData[16] + 1;
if (sendData[16] > '9')
{
sendData[16] = '0';
sendData[15] = sendData[15] + 1;
}
if (sendData[15] > '9')
{
sendData[15] = '0';
}
Delay_ms(1000);
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
UART
Additional notes and information
Depending on the development board you are using, you may need USB UART click, USB
UART 2 click or RS232 click to connect to your PC, for development systems with no UART to
USB interface available on the board. The terminal available in all MikroElektronika compilers,
or any other terminal application of your choice, can be used to read the message.
https://www.mikroe.com/broadrreachclick122017

MIKROE-2796

Mfr. #:
Manufacturer:
Mikroe
Description:
Ethernet Development Tools BroadR-Reach click
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet