FRIENDz

FAILURE IS THE SIGN OF SUCCESS!!

Connect Transmitter Receiver module with 8051 code

The mikroC PRO for 8051 provides a library for handling Manchester coded signals. The Manchester code is a code in which data and clock signals are combined to form a single self-synchronizing data stream; each encoded bit contains a transition at the midpoint of a bit period, the direction of transition determines whether the bit is 0 or 1; the second half is the true bit value and the first half is the complement of the true bit value .

Notes:
  • The Manchester receive routines are blocking calls (Man_Receive_Init and Man_Synchro). This means that MCU will wait until the task has been performed (e.g. byte is received, synchronization achieved, etc).
  • Manchester code library implements time-based activities, so interrupts need to be disabled when using it.

Connect Keypad with 8051 code

The mikroC PRO for 8051 provides a library for working with 4x4 keypad. The library routines can also be used with 4x1, 4x2, or 4x3 keypad. For connections explanation see schematic at the bottom of this page.
Note: Since sampling lines for 8051 MCUs are activated by logical zero Keypad Library can not be used with hardwares that have protective diodes connected with anode to MCU side, such as mikroElektronika's Keypad extra board HW.Rev v1.20
External dependencies of Keypad Library
The following variable must be defined in all projects using Keypad Library:
Description:
Example :
extern sfr char keypadPort;
Keypad Port.
char keypadPort at P0;
Library Routines
  • Keypad_Init
  • Keypad_Key_Press
  • Keypad_Key_Click

Connect CAN Protocol with 8051 Atmel

The SPI module is available with a number of the 8051 compliant MCUs. The mikroC PRO for 8051 provides a library (driver) for working with mikroElektronika's CANSPI Add-on boards (with MCP2515 or MCP2510) via SPI interface.
The CAN is a very robust protocol that has error detection and signalization, selfchecking and fault confinement. Faulty CAN data and remote frames are re-transmitted automatically, similar to the Ethernet.
Data transfer rates depend on distance. For example, 1 Mbit/s can be achieved at network lengths below 40m while 250 Kbit/s can be achieved at network lengths below 250m. The greater distance the lower maximum bitrate that can be achieved. The lowest bitrate defined by the standard is 200Kbit/s. Cables used are shielded twisted pairs.
CAN supports two message formats:
  • Standard format, with 11 identifier bits and
  • Extended format, with 29 identifier bits
Notes:
  • Consult the CAN standard about CAN bus termination resistance.
  • An effective CANSPI communication speed depends on SPI and certainly is slower than “real” CAN.
  • CANSPI module refers to mikroElektronika's CANSPI Add-on board connected to SPI module of MCU.

Connect ADC with 8051 Code

ADC (Analog to Digital Converter) module is available with a number of MCUs. Library routines are included to provide you comfortable work with the module in single-ended mode.

Library Routines

  • ADCx_Init
  • ADCx_Init_Advanced
  • ADCx_Get_Sample
Notes:
  • Some of the MCUs do not support ADCx_Init_Advanced routine. Please, refer to the appropriate datasheet.
  • ADC routines require you to specify the module you want to use. To select the desired module, simply change the letter x in the prototype for a number from 1 to 3
    Number of ADC modules per MCU differs from chip to chip. Please, read the appropriate datasheet before utilizing this library.