GMB HR84 - EXAMPLEs

BASIC = BASCOM-8051; BASCOM-AVR; PicBasic Pro; mikroBASIC.

C Compiler = µC/51; ICC-AVR; HTC-PIC.

PASCAL = mikroPASCAL.

As following you can find a wide range of demo programs. The programs have been realized to be used on a well-known hardware, as the GMB HR84, or the similar ones, in order to avoid any doubts about the interpretation of the results.

The DEMO programs are well documented in order to allow a fast approach for each users. Furthermore a list of proper demo programs have been developed for DEMO versions of BASCOM-8051, BASCOM-AVR, PicBasic Pro, mikroBASIC; µC/51 C Compiler, HTC-PIC or ICC-AVR C Compiler; PASCAL Compiler mikroPASCAL; to allow a real evaluations of the Languages, even without purhasing them. These demo programs are full of Remarks that help the user, during learning and testing phases.

I N D E X

B A S I C

C Compiler

P A S C A L


SHORT PROGRAM DESCRIPTION

 


HELLO

HELLO program is a quite short program that doesn't need any external source for running, just the Mini module powered. Aim of such program is to get the on board LED blinking.
When Mini Module is equipped with two LED, they will blinking alternatively.
It is a simple and good way to be acquainted with the product. HELLO program, whose sources are hereunder available, has been developed both with BASIC and C Compilers.
Note: H20_GMx version is suitable for running at 20MHz.


GMB_IOB

Module GMB HR84 is provided with eight optocoupled NPN/PNP inputs and four Relays outputs visualized through its own LED.
Each of these signals are driven through a TTL digital signal connected to a port of grifo® Mini Module installed on socket ZC1.
This demo allows to use immediatly both buffered inputs and relay outputs available respectively on CN1 and CN6.
In addition, high level functions available on Mini Module are used: inputs may generate Interrupts or Counted by hardware, Outputs can generate automatically periodic signals, etc.


GMB_IOT

This Demo allows to use immediatly TTL I/O digital lines available on CN4. According to grifo® Mini Module used, the list of lines existing is printed. After selecting the line to use it can be managed as input (its status is shown continuously on console) or as output (setting it high or low). Should the line selected be associated to Real Time Clock, this peripheral manages it.


GMB_RTC

grifo® Mini Module CAN GM0, CAN GM1 and CAN GM2 are provided with on board Real Time Clock, RTC, backed through the on board Lithium battery, disconnectable.
Such component can be used to schedule sequences of operations or to create a timestamp for
certain events.
Interface between RTC and Mini Modules is I2C BUS.
Demo program GMB_RTC allows to use immediatly Real Time Clock functionality, both to get and to set time, through a set of widely commented functions.
Such functions are charged to communicate to the component and to show time and date.


GMB_TMP

If grifo® Mini Module is provided with Real Time Clock, this Demo allows to manage three timers that act on relays outputs of CN1. In detail, it is possible to input from console the action to perform and the time of activation for each of the three timers; two timers allow to input a combination for output Relays, the third timer opens all the output r Relays.


GMB_DA

According to grifo® Mini Module selected, if analog input signal on CN4 is available, this Demo offers two possibilities: calibration or acquisition. First action determinates a calibration coefficent using an external reference voltage provided by the user and stored it in Mini Module internal EEPROM. Second action fetches calibration coefficent from EEPROM, acquires and shows continuously on console the analog input combination, both uncalibrated and calibrated. Demo can be used without problems with range 0..2.5 V and 0..10 V.


GMB_DA

This Demo uses section 0 of grifo® Mini Module PCA to generate, on CN4, a PWM signal with preset frequency and duty cycle programmable in percent by console. Such signal, connected to an opportune intergrating circuit (RC network, operational amplifire with capacitor on feedback, etc.) allows to obtain an anlog signal like the one of a D/A. Demo execution depends on which Mini Module is used and serial line configuration.


GMB_SER

This Demo is a simple example of communication capableto work with all electric protocols available on CN2 of grifo® Mini Module (RS 232, RS 422, RS 485 or Current Loop or TTL). In detail, through high level functions, it is possible to program Baud Rate from console, then each character received from serial port is sent to the port itself; reception of character " r " decides how to manage the communication direction (signal DIR) for RS 422 and RS 485.


GMB_I2C

These Demos allow to communicate to I2C BUS devices connected to CN3. According to the grifo® Mini Module installed (for CAN GM0, CAN GM1 and CAN GM2 use Demo who name ends with 'ce.bas', for GMM 5115 use demo whose name ends with G), it is possible to read or write bytes at any slave address and location address input by console. In detail, when reading the byte read is visualized and when writing the byte input is sent.


GMB_CAN

If grifo® Mini Module is provided with CAN line on CN4, this demo allows to program by console the typical parameters of CAN communication, then send and receive messages. Thanks to this flexibility it is possible to communicate to any other device provided with CAN line.


K51 AVR + GMB HR84 Examples

 


K51_AD4

This Demo allows to drive an I2C BUS peripheral on board of K51-AVR, PCF8591, through Mini-BLOCK module GMB HR84 and grifo® Mini Module.
PCF 8591 is provided with four analog inputs for A/D conversions with 8 bits resolution, all the operations of conversion and combination acquisition are performed through synchronous serial interface I2C BUS.
This Demo allows to set which channel to convert through PC keyboard, and to read the combination on the 7 segments display of K51-AVR.


K51_DA

This Demo allows to drive an I2C BUS peripheral on board of K51-AVR, PCF8591, through Mini-BLOCK module GMB HR84 and grifo® Mini Module.
PCF 8591 is provided with one analog output for D/A conversions with 8 bits resolution, all the operations of activation are performed through synchronous serial interface I2C BUS.
This Demo allows to set the voltage output level through PC keyboard, and writes " da " on the 7 segments display of K51-AVR to indicate that Demo is running.


K51_PPI

This Demo allows to drive an I2C BUS peripheral on board of K51-AVR, PCF8574, through Mini-BLOCK module GMB HR84 and grifo® Mini Module.
PCF 8574 is an I/O expander that allows to drive 8 TTL digital lines, both as input and as output, all the operations of read and write are performed through synchronous serial interface I2C BUS.
This Demo acquire the status of eight TTL digital lines, and shows it on the 7 segments display of K51-AVR, near the characters " in ".


K51_PPO

This Demo allows to drive an I2C BUS peripheral on board of K51-AVR, PCF8574, through Mini-BLOCK module GMB HR84 and grifo® Mini Module.
PCF 8574 is an I/O expander that allows to drive 8 TTL digital lines, both as input and as output, all the operations of read and write are performed through synchronous serial interface I2C BUS.
This Demo activates in sequence one line at a time, creating the classic bit shift to the right and to the left, and writes " out " on the 7 segments display of K51-AVR, near the characters " out ".


K51_TER

This Demo allows to drive an I2C BUS peripheral on board of K51-AVR, DS1621, through Mini-BLOCK module GMB HR84 and grifo® Mini Module.
DS1621 is a programmable digital thermometer, whose resolution is half Celsius degreese, all the operations of programming and temperature acquisition are performed through synchronous serial interface I2C BUS.
This Demo shows the Temperature acquired on the 7 segments display of K51-AVR.


BASIC Compiler EXAMPLEs


  EXAMPLEs

BASCOM - 8051

 For GMB HR84 Boards

 CAN GM Zero, CAN GM1, CAN GM2, GMM 5115

HELLO_GM0, H20_GM0, HELLO_GM1, H20_GM1, HELLO_GM2, H20_GM2, HELLO_5115,

  GMB HR84 + (CAN GM0, CAN GM1, CAN GM2, GMM 5115)

GMB_IOB, GMB_IOT, GMB_RTC, GMB_TMP, GMB_AD, GMB_DA, GMB_SER, GMB_I2CC, GMB_I2CG,

 GMB HR84 + GMM 936

HELLO, GMB_IOB, GMB_IOT, GMB_SER, GMB_I2C,

 GMB HR84 + GMM 935

HELLO, GMB_IOB, GMB_IOT, GMB_SER, GMB_I2C,

  GMB HR84 + GMM 932

HELLO, GMB_IOB, GMB_IOT, GMB_SER, GMB_I2C,

  GMB HR84 + (CAN GM0, CAN GM1, CAN GM2) + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,

  GMB HR84 + GMM 5115 + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,

  GMB HR84 + GMM 936 + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,

  GMB HR84 + GMM 935 + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,,

   GMB HR84 + GMM 932 + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER


  EXAMPLEs

BASCOM - AVR

 For GMB HR84 Boards

 GMB HR84 + CAN AVR

HELLO, GMB_IOB, GMB_IOT, GMB_TMP, GMB_AD, GMB_DA, GMB_SER, GMB_I2C,, GMB_CAN,

 GMB HR84 + GMM AM08

HELLO, GMB_IOB, GMB_IOT, GMB_AD, GMB_DA, GMB_SER, GMB_I2CC,

  GMB HR84 + CAN AVR + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,

  GMB HR84 + GMM AM08 + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,


EXAMPLEs

PicBasic

For GMB HR84 Boards

 GMB HR84 + GMM 876

HELLO, GMB_IOB, GMB_IOT, GMB_AD, GMB_DA, GMB_SER, GMB_I2C,

  GMB HR84 + GMM 876 + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,


EXAMPLEs

PicBasic Pro

For GMB HR84 Boards

 GMB HR84 + CAN PIC

HELLO, GMB_IOB, GMB_IOT, GMB_TMP, GMB_AD, GMB_DA, GMB_SER, GMB_I2C,, GMB_CAN,

  GMB HR84 + CAN PIC + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,


EXAMPLEs

mikroBASIC

For GMB HR84 Boards

 GMB HR84 + GMM 876

GMB_IOB, GMB_IOT, GMB_TMP, GMB_AD, GMB_DA, GMB_SER, GMB_I2C,

 GMB HR84 + CAN PIC

GMB_IOB, GMB_IOT, GMB_TMP, GMB_AD, GMB_DA, GMB_SER, GMB_I2C,, GMB_CAN,

  GMB HR84 + GMM 876 + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,

  GMB HR84 + CAN PIC + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,


C Compiler EXAMPLEs


 EXAMPLEs

µC/51

 For GMB HR84 Boards

 CAN GM Zero, CAN GM1, CAN GM2, GMM 5115

HELLO_GM0, H20_GM0, HELLO_GM1, H20_GM1, HELLO_GM2, H20_GM2, HELLO_5115,

  GMB HR84 + (CAN GM0, CAN GM1, CAN GM2, GMM 5115)

GMB_IOB, GMB_IOT, GMB_TMP, GMB_AD, GMB_DA, GMB_SER, GMB_I2C,, GMB_CAN,

 GMB HR84 + GMM 936

HELLO, GMB_IOB, GMB_IOT, GMB_SER, GMB_I2C,

 GMB HR84 + GMM 935

HELLO, GMB_IOB, GMB_IOT, GMB_SER, GMB_I2C,

 GMB HR84 + GMM 932

HELLO, GMB_IOB, GMB_IOT, GMB_SER, GMB_I2C,

  GMB HR84 + (CAN GM0, CAN GM1, CAN GM2) + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,

  GMB HR84 + GMM 5115 + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,

  GMB HR84 + GMM 936 + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,

  GMB HR84 + GMM 935 + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,

  GMB HR84 + GMM 932 + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,


 EXAMPLEs

ICC - AVR

For GMB HR84 Boards

  GMB HR84 + CAN AVR

HELLO, GMB_IOB, GMB_IOT, GMB_TMP, GMB_AD, GMB_DA, GMB_SER, GMB_I2C, GMB_CAN,

  GMB HR84 + GMM AM08

HELLO, GMB_IOB, GMB_IOT, GMB_AD, GMB_DA, GMB_SER, GMB_I2C,

  GMB HR84 + CAN AVR + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,

  GMB HR84 + GMM AM08 + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,


 EXAMPLEs

HTC - PIC 16

For GMB HR84 Boards

  GMB HR84 + GMM 876

HELLO, GMB_IOB, GMB_IOT, GMB_TMP, GMB_AD, GMB_DA, GMB_SER, GMB_I2C,, GMB_CAN,

  GMB HR84 + GMM 876 + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,


 EXAMPLEs

HTC - PIC 18

For GMB HR84 Boards

  GMB HR84 + CAN PIC

HELLO, GMB_IOB, GMB_IOT, GMB_TMP, GMB_AD, GMB_DA, GMB_SER, GMB_I2C,, GMB_CAN,

  GMB HR84 + CAN PIC + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,


PASCAL Compiler EXAMPLEs


  EXAMPLEs

mikroPASCAL

For GMB HR84 Boards

 GMB HR84 + GMM 876

GMB_IOB, GMB_IOT, GMB_TMP, GMB_AD, GMB_DA, GMB_SER, GMB_I2C,

 GMB HR84 + CAN PIC

GMB_IOB, GMB_IOT, GMB_TMP, GMB_AD, GMB_DA, GMB_SER, GMB_I2C,, GMB_CAN,

  GMB HR84 + GMM 876 + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,

  GMB HR84 + CAN PIC + K51 AVR

K51_AD4, K51_DA, K51_PPI, K51_PPO, K51_TER,


Page up-dated at October 11, 2006


homeHome Categorical Index CPU Tables Data. S. Examples Prog.             Articles