Sysblocks Getting Started Guide

From Flowcode Help
Revision as of 14:23, 28 November 2023 by MartinW (talk | contribs)
Jump to navigationJump to search

SysblocksGSG1.png

Introduction to Sysblocks

SysblocksGSG2.png

Sysblocks and Flowcode 10 provide a new way of teaching about signal processing for Music technology, DSP, Communications and Software Defined Radio.

Hardware:

The opportunity of developing a product like Sysblocks is facilitated by the advent of advent of low cost high speed, high power microcontrollers - in this case a 32bit PICmicro microcontroller. The Sysblock hardware topology is very simple: Input buffer …..A/D….processor...D/A….output amplifer.

Sysblocks boards also include two E-blocks II boards so that students can use a wide variety of expansion boards from Matrix, Grove, Mikroelektronika and others.

Software:

Flowcode 10 software is a graphical programming solution for microcontrollers and PCs. Flowcode allows those with limited programming experience to develop complex electronic systems using graphical and conventional C code programming.

Curriculum: There are three separate curricula for Sysblocks and Flowcode 10:

  • Music with microcontrollers
  • Systems, signals, DSP, and FFT
  • Communications and Software Defined Radio

The following information will explain to you how Sysblocks and Flowcode 10 can be used to provide fantastic learning opportunities in electronics.

Hardware: PCB overview

SysblocksGSG3.png

1. Fast 32 bit PIC processor                                    16. Input switch SW2 

2. PIC18F24K50 control processor that handles                   17. E-blocks II expansion port A  
   the USB communications, 32 bit PIC programming,                    
   LCD display, encoders and input switches                     18. E-blocks II expansion port B 

3. SMA connector  Input IN0                                     19. USB socket / power in 

4. AC / DC coupling switch SW4                                  20. 2.1mm power jack, 5 - 12V 

5. SMA connector  Input IN1                                     21. Screw terminal power connector (input or output)

6. AC / DC coupling switch SW3                                  22. 2 x banks of 8 user programmable  LEDs - for VU meters 

7. SMA connector Output OUT0                                    23. Grove sensor expansion socket 

8. SMA connector  Output OUT1 

9. 3.5mm jack stereo line in 

10. 3.5mm jack stereo line out 

11. 4 line monochrome LCD display 

12. Rotary encoder input ENC0 

13. Rotary encoder input ENC1 

14. Input switch SW0 

15. Input switch SW1 

Hardware: block diagram

SysblocksGSG4.png

Sysblocks has four analogue inputs, two analogue outputs and support circuitry.

At the heart of the system is a very powerful 32 bit Micro chip PICmicro microcontroller running at 200MHz. This is capable of standard microcontroller type functions and also is capable of Digital Signal Processing the incoming audio signals. The 32 bit processor has a Coremark of 652 (around 330 Drystone MIPS) which is more than fast enough for the signal processing tasks involved for learning about Music technology, Digital Signal Processing and Modern communications theory.

The 32 bit PICmicro microcontroller is programmed by a host device which is a standard 18 series PICmicro microcontroller. This host device takes care of non-core tasks like USB communications, LCD display, encoder and switch inputs. This architecture keeps the main 32bit device free for signal processing.

Two E-blocks ports are made available for expansion. E-block boards for Wifi, keypad, Bluetooth, CAN, Zigbee and many other functions are available. This gives huge flexibility to the Sysblocks system as a wide range of projects can be built around it. A Grove connector is also available which allows users to access the wide range of Grove accessories.

The analogue input signals are buffered and level shifted to half of the supply voltage – 1.65V – and then fed to the internal A to D converters of the main 32 bit PICmicro microcontroller. A digital potentiometer allows the level of the input signals to be adjusted in software.

The microcontroller processes the digital signals and feeds the results to 2 x external R2R ladder DACs which are buffered by operational amplifier circuits. Line out left and right include a digital potentiometer that allows the output level to be adjusted in software.

The board is fitted with a number of switches and encoders for control purposes. The board also has a miniature monochrome graphical display and a number of programmable LEDs including 2 x 8 LED VU meter LEDs.

The board is powered from 3.3V from USB or from a plug top power supply.

· Vin max      2.2V pk to pk 
· Vout max     2.2V pk to pk 

Hardware: Sysblocks products

SysblocksGSG5.png

BL8386 is our standard Sysblocks< experimentation panel.

It consists of a single Sysblocks board on a plastic panel with power supply and USB lead and is shipped in a standard tray for storage.

The Sysblocks board is protected with a clear acrylic cover to make it more rugged in the lab.

Students use conventional oscilloscopes and spectrum analysers to examine the results of
signal processing in a music and DSP context.
















SysblocksGSG6.png

BL9296 is our Sysblocks Communications panel. This includes 3 x Sysblocks boards and a signal mixer board on a plastic panel. This configuration allows students to experiment with lots of different types of communications and examine their characteristics.

The first Sysblocsk board is used to modulate and / or encode a signal into a digital format. The second Sysblocks board is used to generate noise. The encoded/modulated signal and noise are mixed together in the mixer board and fed into the third Sysblocks board. Where the signal is then demodulated/decoded and fed to the outputs. Separate programs are used in each Sysblock. This configuration allows students to experiment with multiple modulating/demodulating and encoding/deconding systems and examine their noise characteristics.

The Sysbocks Communications panel is supplied with a set of 6 micro BNC leads, USB lead and power supply in a standard tray. Sysblocks boards are protected with clear acrylic covers. Students use conventional oscilloscopes and spectrum analysers to examine the signals in the system.








Software: Flowcode

SysblocksGSG7.png

SysblocksGSG8.png




Flowcode 10 Electronic system design software includes Data flow / DSP components which you can see on the right. This programming paradigm allows students to build a wide variety of signal processing systems using conventional graphics that are used in text books and papers to describe the behaviour of signal processing systems.

To build a system students simply select the DSP / Data flow operator they want from the component library and drag it onto the panel. They then select the component’s properties and connect the relevant inputs to the outputs of other icons to create a functioning system. They then connect inputs and outputs to the real world – A/D and D/A. Students can combine these data flow programs with flow charts, C code, pseudocode and state machine diagrams to produce highly functional electronic systems based on microcontrollers and Windows computers.

Once the system is constructed students can use the internal simulation engine to see the results of the programusing the internal logic analyser and oscilloscope tools.

Once they are happy with their program they can compile it to the powerful Sysblock 32 bit PIC in just a few seconds. They can then use conventional oscilloscopes, spectrum analysers and other instruments to see their program working.

The images that follow demonstrate the kind of systems that can be developed with Flowcode 10.


































Your first Sysblocks program

SysblocksGSG9.png

1 Create a new project

Choose a target for a new project. You can find the SysBlocks by the path 32-bit PIC->Misc->SysBlocks.



















2 Add the Sysblocks control panel to the 2D panel

One of the potential difficulties with the Sysblocks architecture is that there are two processors on the board that handle different tasks. Flowcode takes care of this through a hardware component that allows access to the switches, display, and encoders. A single component allows easy access to all of them for the user.

SysblocksGSG10.png


SysblocksGSG11.png










From Component Libraries->Hardware->E2Blocks->SysBlocks.












3 Develop your program

Use a component macro to initialise the Sysblocks component. Create a loop - while 1 - and Use Sysblocks LED component macro, and a couple of 100ms delays, to flash LED 1 on and off.

SysblocksGSG12.png


4 Simulate your program

Select DEBUG...RUN to simulate the program

SysblocksGSG13.png


5 Program the Sysblocks board

SysblocksGSG14.png

Congratulations! You have built your first Sysblocks program. LED 0 should be flashing at 1 second intervals.


6 Create a Data flow program

For a Data flow program you need to add at least one Input ADC and one Output Port from the Components Libraries. You can find the Input ADC and Output Port in the DSP section of Flowcode which is under the Components Libraries. You need to drag them to the 2D Panel.

SysblocksGSG15.png

SysblocksGSG16.png
SysblocksGSG17.png











After dragging them to the 2D Panel, you need to connect the components DSP_PortOut and DSP_AdcIn together by setting up the properties of DSP_PortOut. The properties would be shown in the right if you click the component DSP_PortOut in 2D Panel. Click the triangle of the Ref1::LinkTo to connect the component DSP_PortOut to the component DSP_AdcIn. If they are connected, you will see a line between them. Select Autoscale for DSP_PortOut to YES. The sampling is 12 bit but the output is 16 bit and Autosclale takes care of that. Of course this is a very simple program - we take an input, sample it at 3kHz to create a digital data stream, we pass that to an output DAC and recreate the signal. Its not a very useful program, but it gets the system up and running and you can then add other data processing icons to develop a more complex system.





7 Connect the input port

SysblocksGSG18.png

You need to set up the input in the hardware of the Sysblocks board by right clicking the DSP_AdcIn in 2D and selecting Properties. Under CONNECTIONS … CHANNEL select the input port you want. We have selected AN0 which is the Micro BNC IN0.





























8 Connect the output port

You need to set up the mapped Port in the hardware of the Sysblocks by click the PortSelection in the properties of DSP_PortOut. The two output ports of the Sysblocks board could be Port J (OUT0) and Port H (OUT1) , which you can check with the User Drawing at the Appendix of this document. Just choose one mapped port for the Output. Also, you need to set the AutoScale as Yes in the Properties of DSP_PortOut to make sure the output data does not overflow.

SysblocksGSG19.pngSysblocksGSG20.png

9 Setting up the interrupt

SysblocksGSG21.png

Add an Interrupt icon to the start of your program.
Double click to set the properties.
Select Timer 1 to call a new macro: Data-flow.
Click on CREATE NEW MACRO to create the new Data-flow macro

SysblocksGSG22.png

SysblocksGSG23.png




Set the Properties of the interrupt so that the interrupt frequency
is 3051Hz.

This is now the ‘Tick’ frequency for your Data flow program.







10 Your Data flow program Add the AddSample and WritePort to the Data_flow macro. Every time there is an interrupt these routines in the Data flow program will be executed. You can now send the program to the board as in step 5. Note that you still have your Main flow chart program executing: so LED0 is flashing at regular intervals at the same time as the Data Flow program is running.

SysblocksGSG24.png

11 Evaluating the first program

SysblocksGSG25.png

For this section you will need a signal source and a two channel oscilloscope like a Picoscope. The Pico scope has a waveform generator that you can use as a signal source. You will need a splitter so that you can feed this into channel A of the scope and IN0 on the Sysblocks board. Set switch SW4 to AC