Difference between revisions of "GSM Application Guide"

From Flowcode Help
Jump to navigationJump to search
(Created page with " == Introduction == These examples demonstrate the use of Flowcode and serial AT commands to control a GSM modem. In particular they make use of the EB066 E-blocks GSM boar...")
 
Line 51: Line 51:
 
{{Fcfile|Apps_GSM_Ex1_Send_Text.fcfx|Text Message Sending Example}}
 
{{Fcfile|Apps_GSM_Ex1_Send_Text.fcfx|Text Message Sending Example}}
  
Example 1
+
Example 1 demonstrates how to construct character arrays that are used as text strings for the destination mobile number and the contents text message. These are then used as parameters of the AT commands to be sent to the GSM modem.
 +
 
 +
The recipient mobile phone number is specified at the start of the program by initializing an array of byte variables with the numeric data.
 +
Ensure that you change this data to a valid mobile destination number before you compile to your target hardware!
 +
 
 +
The text content of the message is specified next in the program. The array must be large enough to allow for the complete contents of the message to be initialized. The number 32 represents an ASCII encoded space character and the number 0 represents a string termination. A line feed is encoded as a number 10 and a carriage return as the number 13.
 +
 
 +
The GSM modem uses a command terminology known as AT commands. The AT commands always start with the characters “A” and “T” to bring the remote device to attention. Sending a number 13 to represent a carriage return has the effect of allowing the AT command to be executed on the GSM modem. If the command is successful then we should receive an OK back from the modem using the GSM_RCEVE macro. The GSM_DELAY macro simply allows for a delay in between commands.

Revision as of 13:52, 1 September 2014

Introduction

These examples demonstrate the use of Flowcode and serial AT commands to control a GSM modem.

In particular they make use of the EB066 E-blocks GSM board, connected to an EB006 E-blocks PICmicro multiprogrammer fitted with a 16F1937 microprocessor.

However, the examples are easily changed in Flowcode to support other microprocessors and platforms.

The Matrix TSL EB452SI6 Easy GSM bundle has all the items required for these sample applications and is an ideal introduction to GSM (Global System for Mobile) communication technology.


Setting up the project hardware

Connect the E-Blocks as indicated in the table below.

The GSM, Sensor and LCD E-Blocks all need to be powered via wire connections to the +V on the EB006.

In addition, the GSM board requires the Vpwr terminal connecting to the Vpwr (or +14V) terminal of the EB006.


Hardware Setup
EB006 PICmicro multiprogrammer
EB090 E-blocks Sensor Motherboard Port A
EB005 E-blocks LCD board Port B
EB066 E-blocks GSM board Port C
EB014 E-blocks Keypad board Port D


Example 1: Text message sending

FC6 Icon.png Text Message Sending Example

Example 1 demonstrates how to construct character arrays that are used as text strings for the destination mobile number and the contents text message. These are then used as parameters of the AT commands to be sent to the GSM modem.

The recipient mobile phone number is specified at the start of the program by initializing an array of byte variables with the numeric data. Ensure that you change this data to a valid mobile destination number before you compile to your target hardware!

The text content of the message is specified next in the program. The array must be large enough to allow for the complete contents of the message to be initialized. The number 32 represents an ASCII encoded space character and the number 0 represents a string termination. A line feed is encoded as a number 10 and a carriage return as the number 13.

The GSM modem uses a command terminology known as AT commands. The AT commands always start with the characters “A” and “T” to bring the remote device to attention. Sending a number 13 to represent a carriage return has the effect of allowing the AT command to be executed on the GSM modem. If the command is successful then we should receive an OK back from the modem using the GSM_RCEVE macro. The GSM_DELAY macro simply allows for a delay in between commands.