R10 22k. R9 10k PICAXE-08M RXD. Sample Program: main: high 4 pause 1000 low 4 pause 1000 goto main R7 330 D7 LED-RED.



Similar documents
- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

Serial Communications

AXE114S BINARY CLOCK. revolution Revolution Education Ltd. Web: Version /09/08 AXE114.PMD.

PICAXE VSM Tutorial Part 4

CHAPTER 11: Flip Flops

EvB 5.1 v5 User s Guide

Elettronica dei Sistemi Digitali Costantino Giaconia SERIAL I/O COMMON PROTOCOLS

XPort Universal Demo Board User Guide

2-Port RS232/422/485 Combo Serial to USB2.0 Adapter (w/ Metal Case and Screw Lock Mechanism) Installation Guide

revolution Contents: Introduction Power 28-pin Project Board with input/output cables

Using HyperTerminal with Agilent General Purpose Instruments

AXE033 SERIAL/I2C LCD

L16. Quectel GNSS Engine. EVB User Guide L16_EVB_UGD_V1.0

USING I2C WITH PICAXE

PICAXE NET SERVER (NET001)

PICAXE COLOUR SENSOR. revolution. Overview: Contents (AXE045 Colour Sensor): Contents (AXE112S Starter Pack): General Operation:

Pmod peripheral modules are powered by the host via the interface s power and ground pins.

Bluetooth HC-06 with serial port module Easy guide

SD21-21 Channel Servo Driver Module Power Servo's

Quick Start Guide for High Voltage Solar Inverter DC-AC Board EVM. Version 1.3

MODULE BOUSSOLE ÉLECTRONIQUE CMPS03 Référence :

MFRD52x. Mifare Contactless Smart Card Reader Reference Design. Document information

PICAXE DATALOGGER (AXE110P)

USER GUIDE Programming Adapter Cable for Fujitsu Flash Microcontroller- F²MC-16LX/FR Family Fujitsu Microelectronics America, Inc.

L10. Quectel GPS Engine. EVB User Guide L10_EVB_UGD_V1.00

MDM192 MULTI-DROPS DIGITAL MODEM FOR PRIVATE LINE. USER GUIDE Document reference :

Lab Experiment 1: The LPC 2148 Education Board

RJ45 Shielded (standard) port pinout. CS9000, Jetstream , Lanstream 2000, RTA8/RJX, RRC16, MTA8/RJX & SXDC8/RJX

ARDUINO SEVERINO SERIAL SINGLE SIDED VERSION 3 S3v3 (REVISION 2) USER MANUAL

Teleservice via RS232 interface XC100/XC200

Bluetooth to serial HC-06 wireless module

Programming the On-Chip Flash on a phycore-xc161 phycore-xc167

AXE027 PICAXE USB CABLE

AN141 SMBUS COMMUNICATION FOR SMALL FORM FACTOR DEVICE FAMILIES. 1. Introduction. 2. Overview of the SMBus Specification. 2.1.

Quectel Cellular Engine

T-BOXN12R. First steps with T-BOXN12R. You can make it wireless. Date: Version 1.0

USB to serial chip CH340

Modbus Communications for PanelView Terminals

Data Bulletin. Communications Wiring for POWERLINK G3 Systems Class 1210 ABOUT THIS BULLETIN APPLICATION INTRODUCTION.

USB / Data-Acquisition Module NOW LEAD-FREE

Serial port interface for microcontroller embedded into integrated power meter

Date Rev. Details Author

Orbit PCI Mk 2 Network Card. User Manual. Part No Issue 4

How To Set Up A Modem (Marc) Model (Marc) Model 2 (Marr) Model 1 (Marm) Model 4 (Mariar) Model 8 (Marp) Model 6 (Mar

A guide to using Blockly to simulate and program a PICAXE microcontroller

PICAXE Manual

Application/Connection Examples

Using a Laptop Computer with a USB or Serial Port Adapter to Communicate With the Eagle System

Application Note 2. Using the TCPDIAL & TCPPERM Commands to Connect Two TransPort router Serial Interfaces Over TCP/IP.

ELAN DIGITAL SYSTEMS LTD. SL232 PC- CARD USER S GUIDE

version 3.1. Security modem with USB port user guide

BE635 User Manual. Rev. V Bolymin, Inc. All Rights Reserved.

IP SERIAL DEVICE SERVER

32 Transferring Projects and Data

LTM-1338B. Plus Communications Manual

PICAXE RF CONNECT KIT (AXE213)

Work with Arduino Hardware

GTS-4E Hardware User Manual. Version: V1.1.0 Date:

How To Connect A Directsofl To A Powerpoint With An Acd With An Ctel With An Dm-Tel Modem On A Pc Or Ipad Or Ipa (Powerpoint) With A Powerline 2 (Powerline

What is Easy-Radio? Devices Covered. Frequency Hopping Transceiver. Where x00 denotes frequency of operation. E.g. 400 = 433MHz

ic-mq EVAL MQ1D EVALUATION BOARD DESCRIPTION

DK40 Datasheet & Hardware manual Version 2

Docklight V2.1 User Manual 08/2015. Copyright 2015 Flachmann und Heggelbacher GbR

ET-BASE AVR ATmega64/128

Config software for D2 systems USER S MANUAL

EVAL-UFDC-1/UFDC-1M-16

s!nus-elektrotechnikai bt. Industrial IT & Automation

User s Manual of Board Microcontroller ET-MEGA2560-ADK ET-MEGA2560-ADK

Ocean Controls RC Servo Motor Controller

PolyBot Board. User's Guide V1.11 9/20/08

Designing VM2 Application Boards

The basic set up for your K2 to run PSK31 By Glenn Maclean WA7SPY

The Analyst RS422/RS232 Tester. With. VTR, Monitor, and Data Logging Option (LOG2) User Manual

User Manual IC-485AI

GSM Click - Cross-Platform Development Quick Start Guide

VDIP1. Vinculum VNC1L Module. Datasheet

Vicon Flash Upgrade Software

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

STUDY OF CELLPHONE CHARGERS

C4DI Arduino tutorial 4 Things beginning with the letter i

Troubleshooting and Diagnostics

Rev.5. Installation and operating instructions

USER GUIDE EDBG. Description

Single channel data transceiver module WIZ2-434

USBEE DX TEST POD USERS MANUAL CWAV.

Manual Serial PCI Cards

Experiment 2 Diode Applications: Rectifiers

Web Site: Forums: forums.parallax.com Sales: Technical:

M72. Quectel Cellular Engine. EVB User Guide M72_EVB_UGD_V1.0

WICE-SPI Hardware Operation Manual

SUDT AccessPort TM Advanced Terminal / Monitor / Debugger Version 1.37 User Manual

RS-232 COMMUNICATIONS

POCKET SCOPE 2. The idea 2. Design criteria 3

Hardware Reference. Linux Device Server IGW/922 with DIL/NetPC ADNP/9200

Chapter 4: Pulse Width Modulation

MARTECH SPI Tools. MARTECH SPI Tools User Manual v1.0. User Manual

CITIZEN OPOS DRIVER 1.8 Setup Guide. 10/03/29 Rev 1.09

Future Technology Devices International Ltd

Modification of an AOR AR-8600 receiver to tune it with a ACECO FC-3002 frequency finder

Transcription:

PICAXE VSM Tutorial Part PICAXE VSM Tutorial Part In the third part of our PICAXE VSM tutorial we look at how to use some of the virtual instrumentation included with the software from simple voltmeter to advanced ic protocol debugger! Virtual Instrumentation After you have designed a circuit using PICAXE VSM, you will naturally want to test it! Fortunately VSM has a wide range of virtual instruments available for testing purposes. This article assumes you are familiar with how to draw circuits in the VSM software, having worked through the tutorials in parts and of this series. Voltmeter and Ammeter Voltage and current can be measured in two separate ways. As an example, open the high command.dsn sample file from the /samples/picaxe/commands folder. You will then need to use the File>Save As menu to save with a different filename so you can experiment and save modifications to it. P P P P P CT V PICAXE SOCKET R k R k PICAXE-M U PICAXEM Sample Program: high pause low pause R +. D LED-RED Volts Date: Filename: high command test.dsn // Title: high command Time: :: Revolution Education Ltd (www.picaxe.co.uk) Page: of For educational use only. All PICAXE circuit schematics and PCB designs are protected by international copyright. No commercial use. E&OE. By: REV-ED Rev: J A B C D E F G H K Figure. Simple LED circuit with voltmeter attached. As shown in Figure this circuit already has a traditional voltmeter connected across the LED. When run the voltmeter will show the voltage when the LED switches on and off. Revolution Education Ltd www.picaxevsm.com

PICAXE VSM Tutorial Part An ammeter can be added by deleting the wire between the resistor and PICAXE pin. Right click and select Place>Virtual Instrument>DC Ammeter. Once dropped, right click on the ammeter symbol and edit the properties Display Range from amps to milliamps. Then draw the two wires back in as shown in Fig.. When run you will now have a display of both current and voltage. If you change any of the other component properties e.g. (changing the Forward Voltage of the LED from V to.v or the resistor from to ) you will see corresponding changes in the current. Figure. Virtual Ammeter added to the circuit. Remember to change to ma range! Revolution Education Ltd www.picaxevsm.com

PICAXE VSM Tutorial Part The second, slightly simpler, way of measuring voltage and current is to just add probes onto any component pin or wire. To do this right click, select place and then either the voltage or current probes (see figure ). Once the simulation is run the probes will show the current or voltage at the probe position. Figure. Right-click the mouse to add voltage and current probes. Revolution Education Ltd www.picaxevsm.com

PICAXE VSM Tutorial Part Oscilloscope On occasions you may wish to trace the voltage or a signal over a period of time. This is when the virtual oscilloscope is of use This time open the infrain.command dsn sample file and re-save with a different filename. This uses a simulated IR LED and IR receiver (e.g. equivalent of the TSOP). Two channels of the oscilloscope are connected across the LED output and the receiver output. CT V PICAXE SOCKET R k R k PICAXE-M P P P P P U PICAXEM PICAXE-M P P P P P CT V PICAXE SOCKET R k R k U PICAXEM Sample Program: infraout, pause R A B C D R k R D LED-RED Sample Program: infrain if infra = then high pause low pause end if IRL Demodulator IRLINK Date: Filename: infraout command test.dsn // Title: infrain / infraout commands Time: :: Revolution Education Ltd (www.picaxe.co.uk) Page: of For educational use only. All PICAXE circuit schematics and PCB designs are protected by international copyright. No commercial use. E&OE. By: REV-ED Rev: J A B C D E F G H K Figure. Two PICAXE chips communicating via a simulated infra-red link. Revolution Education Ltd www.picaxevsm.com

PICAXE VSM Tutorial Part When run the oscilloscope display panel will appear on screen, showing the trace from the two channels. As can be seen from figure the top LED trace clearly shows the modulating signal, whilst the receiver trace shows the de-modulated, inverted output! The virtual oscilloscope includes all controls that you would expect to find on a real device, and so the position, time base etc can all be adjusted as you require. Figure. Virtual oscilloscope trace. Revolution Education Ltd www.picaxevsm.com

PICAXE VSM Tutorial Part Serial Terminal This time take a look at the sertxd command.dsn sample file. This demonstrates the Virtual Terminal which acts as an RS serial terminal fro testing programs with serial data. When run, the serial data output from the PICAXE chip is displayed on screen within the terminal window. Figure. Serial Terminal Demonstration Revolution Education Ltd www.picaxevsm.com

PICAXE VSM Tutorial Part As with all serial systems you do need to set the baud rate and polarity of the terminal to match the PICAXE settings (,n,, (inverted polarity) in this case). This is carried out by right clicking on the terminal symbol and selecting Edit Properties. Figure. Remember to set the serial baud rate and other parameters, otherwise you will see corrupt characters on screen! Revolution Education Ltd www.picaxevsm.com

PICAXE VSM Tutorial Part COMPIM Whilst we are talking about serial communication it is also worth mentioning the COMPIM (COM Physical Interface Model). This symbol acts as a link between the simulator and the real serial port of the computer. This, amazingly, allows connection of real serial devices to a simulated PICAXE chip! As an example you could connect a serial GPS module to the serial port of the computer and then have the simulated PICAXE chip parse the NMEA serial data stream! The COMPIM demo.dsn file demonstrates the COMPIM feature. COMPIM Example This example accepts sertxd serial data from a real PICAXE part, via the COMPIM part (COM Physical Interface Model) The real PICAXE part transmits data via the programming cable. This is received by the model PICAXE, which then switches the LED on and off and makes a sound. First download the following program into a real PICAXE part: sertxd ("on") pause sertxd ("of") pause This transmits data to the computer via the programming cable every seconds. CT V PICAXE SOCKET R k R k R k U RST IN IN IN IN IN PICAXE-X PICAXEX OUT OUT OUT OUT OUT OUT OUT OUT serin,t,("o"),b if b = "f" then low sound,(,) ' make a piezo beep else high ' flash LED sound,(,) ' make a piezo beep end if LED LED-BIRG Make sure you exit the Programming Editor software to free the serial port, and make sure that serial port is selected within the COMPIM model. Then click play to run the design - the LED will switch on and off when the serial data is received. P DCD DSR RTS CTS DTR RI SW RESET PZ R ERROR PIEZO COMPIM Make sure you edit the correct COM port within the model properties. Also make sure that no other software (e.g. Programming Editor) is open and using that COM port. Date: Filename: COMPIM Demo test.dsn // Title: COMPIM Demo Time: :: Revolution Education Ltd (www.picaxe.co.uk) Page: of For educational use only. All PICAXE circuit schematics and PCB designs are protected by international copyright. No commercial use. E&OE. By: Rev: Figure. Demonstration of the COMPIM feature. Revolution Education Ltd www.picaxevsm.com

PICAXE VSM Tutorial Part Signal Generator The Signal Generator is demonstrated via the count command.dsn file. When this simulation is run the Signal Generator control panel is displayed on screen. First make sure the generator is outputting a square wave (saw-tooth, triangular and sine are also available) of around V, and then try adjusting the frequency. The change in frequency should result in a different count command value displayed on the serial terminal. Figure. Virtual Signal Generator An alternate, simpler, way of applying test signals to a wire is to just drop a generator probe onto the wire (as with the voltage and current probes). This is carried out by rightclicking and selecting Place>Generator. Revolution Education Ltd www.picaxevsm.com

PICAXE VSM Tutorial Part SPI and IC debuggers SPI and IC are two different communication protocols used to link ICs together. The protocols are quite complex, but fortunately the technicalities of the protocols are taken care of automatically in the PICAXE system, via use, as an example, of the writeic and readic commands. However those interested in studying these protocols further may be interested in the function of the ic and spi debugger instruments. For instance, the writeic command.dsn file demonstrates how the ic debugger instrument is connected to the ic bus. R k R k R k VIRTUAL TERMINAL RTS CTS CT V Sample Program PICAXE SOCKET init: icslave %,icslow,icbyte R k R k U RST IN IN IN IN IN PICAXE-X PICAXEX SW RESET OUT OUT OUT OUT OUT OUT OUT OUT SDA SCL TRIG IC SCK SDA WP LCB IC inc b dec b sertxd ("W rite ",#b," at address ",#b,cr,lf) writeic b,(b) pause readic b,(b) sertxd ("Read ",#b," at address ",#b,cr,lf) if b = b then sertxd ("Pass - Read & W rite match",cr,lf,cr,lf) else sertxd ("Fail - Read & W rite do not match",cr,lf,cr,lf) end if pause Date: Filename: writeic command test.dsn // Title: readic / write ic commands Time: :: Revolution Education Ltd (www.picaxe.co.uk) Page: of For educational use only. All PICAXE circuit schematics and PCB designs are protected by international copyright. No commercial use. E&OE. By: Rev: Figure. IC debugger analysing data written to a LCB EEPROM Revolution Education Ltd www.picaxevsm.com

PICAXE VSM Tutorial Part When the simulation is run the details of each ic transaction start signal (S), address (AO), data pulses, ack pulses (A), nack pulses (N), stop signals (P) etc. are clearly listed in sequence on screen. This makes it an invaluable learning tool for those interested in understanding these protocols. Figure. IC debugger trace. This shows the time, and type, of all activity on the ic bus Summary The software also contains a few other instruments such as a logic analyser have a play with them! Using virtual simulated instruments will never be quite the same experience as twiddling dials on real-life bench top models. However PICAXE VSM incorporates an impressive array of virtual instruments and you certainly wouldn t be able to buy a new oscilloscope, signal generator or ic debugger for the same price as a VSM licence! Revolution Education Ltd www.picaxevsm.com