GMB HR246 - EXAMPLEs

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

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

PASCAL Compiler = 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 HR246, 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

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 HR168 is provided with 16 optocoupled NPN/PNP inputs and 8 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.


BASIC Compiler EXAMPLEs


  EXAMPLEs

BASCOM - 8051

 For GMB HR246 Boards

+ GMM 40 pin

 GMB HR246 + GMM AC Zero

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

 GMB HR246 + GMM AC2

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

+ CAN + GMM 28 pin

  CAN GM Zero, CAN GM1, CAN GM2

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

  GMB HR246 + (CAN GM Zero, CAN GM1, CAN GM2)

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

 GMB HR246 + GMM 5115

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

  GMB HR246 + GMM 936

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

  GMB HR246 + GMM 935

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

  GMB HR246 + GMM 932

HELLO, GMB_IOB, GMB_IOT, GMB_RTC, GMB_TMP, GMB_DA, GMB_SER, GMB_I2C,


  EXAMPLEs

BASCOM - AVR

 For GMB HR246 Boards

+ GMM 40 pin

 GMB HR246 + GMM AM128

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

 GMB HR246 + GMM AM32

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

+ CAN + GMM 28 pin

  GMB HR246 + CAN AVR

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

  GMB HR246 + GMM AM08

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


EXAMPLEs

PicBasic Pro

For GMB HR246 Boards

+ GMM 40 pin

 GMB HR246 + GMM 4620

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

+ CAN + GMM 28 pin

  GMB HR246 + CAN PIC

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

  GMB HR246 + GMM 876

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


EXAMPLEs

mikroBASIC

For GMB HR246 Boards

+ GMM 40 pin

 GMB HR246 + GMM 4620

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

+ CAN + GMM 28 pin

  GMB HR246 + CAN PIC

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

  GMB HR246 + GMM 876

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


C Compiler EXAMPLEs


 EXAMPLEs

µC/51

 For GMB HR246 Boards

+ GMM 40 pin

  GMB HR246 + GMM AC Zero

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

  GMB HR246 + GMM AC2

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

+ CAN + GMM 28 pin

  CAN GM Zero, CAN GM1, CAN GM2

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

 GMB HR246 + (CAN GM Zero, CAN GM1, CAN GM2)

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

 GMB HR246 + GMM 5115

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

  GMB HR246 + GMM 936

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

  GMB HR246 + GMM 935

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

  GMB HR246 + GMM 932

HELLO, GMB_IOB, GMB_IOT, GMB_RTC, GMB_TMP, GMB_DA, GMB_SER, GMB_I2C,


 EXAMPLEs

ICC - AVR

For GMB HR246 Boards

+ GMM 40 pin

  GMB HR246 + GMM AM128

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

  GMB HR246 + GMM AM32

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

+ CAN + GMM 28 pin

  GMB HR246 + CAN AVR

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

  GMB HR246 + GMM AM08

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


 EXAMPLEs

HTC - PIC 18

For GMB HR246 Boards

+ GMM 40 pin

  GMB HR168 + GMM 4620

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

+ CAN + GMM 28 pin

  GMB HR246 + CAN PIC

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

  GMB HR246 + GMM 876

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


PASCAL Compiler EXAMPLEs


EXAMPLEs

mikroPASCAL

For GMB HR246 Boards

+ GMM 40 pin

 GMB HR246 + GMM 4620

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

+ CAN + GMM 28 pin

  GMB HR246 + CAN PIC

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

  GMB HR246 + GMM 876

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


Page up-dated at February 03, 2006


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