Content
 Parsic

Notes:	All product names mentioned in this description are brands of the respective companies. It cannot be inferred that the name is a free brand name from the being missing ® or TM of the trademarks.

last update: 30.09.2002

Introduction

Objects

1st. program

Creating objects

Connections

Connecting Pin's

Deleting Objects

Microcontroller settings

Moving Objects

Names

Parsic settings

Project settings

RAM and ROM

Simulation

Swen Gosch, Norderstrasse 23 -25335 Elmshorn, Tel.: +49 (0) 4121-22039

E-mail: Swen.Gosch@ t-online.de

All rights reserved. No part of this software may be duplicated or spreaded in anyway (disc, CD-ROM or another medium). The author is not responsible for damages or troubles resulting from the software. A liability for damages or resultant damages  perhaps appearing isn't assumed.


 Objects

AND-Gate

Arithmetic

Bit and byte dispatcher

Call

Counter

Counter (up and down)

Comparisons

Delay

Data source

EEProm

GND and VCC

INCLUDE

Inverter

Impulse input

Impulse output

Label

LCD - define module connection

LCD - display module texts or variable

Limite

Mono-Flop

Multiplexer

Or-Gate

One-Shot

RS Flip-Flop

Shiftregister

Schmitt-Trigger

Sleep mode

Table

Timer

UART (serial interface)

UART data


 Introduction

PIC-Microcontroller are excellently qualified to reduce complex wirings to a minimum. Where in the past complete euro-boards were necessary for extensive wirings nowadays a PIC-Microcontroller already suffices with a couple of periphery components.

But such a Microcontroller wants to be programmed, that means the following hurdles have to be settled before:

1.	study datasheets

2.	perhaps dealing with language C

3.	learning assembler commands

Somebody who never had to deal with such "small things" will give up hope latest at the assembler programming. We developed Parsic to give the "normal" electronics technician a get in.

Something more unusual shall be programmed - no problem Parsic has got the required function to tie INCLUDE files.

For the programming with Parsic you don't need any experience in the programming of PIC's but basic knowledge in the digital electronics should be available.

What you must know using Parsic

1.	which microcontroller I want to use

2.	the clock frequency

3.	the oscillator type (RC, XT, HS, LP)


 The first program

Note:	If you have a project translated over file > build, Parsic creates a project file for MPLAB automatically (PROJEKTNAME.PJT). You must open this file about "Project > Open", only.

Here now the short form how the function project of Parsic comes into the microcontroller.

You have purchased the development system Picstart-Plus. A PIC16C84-04 is enclosed. This microcontroller doesn't have any A/D transducer, but the advantage that you don't need any UV fire eraser. The PIC16C84 can be programmed 100 times at least. The newer PIC16F84 even up to 1000 times. Enough clearance for experiments therefore.

The process of programming is the following:

1.	Create source text with Parsic or

2.	write or correct source text (*.ASM)

3.	Translate with MPASM or MPASMWIN (*.HEX)

4.	burn program (needs only a few seconds)

5.	testing

If you haven't installed MPLAB of MICROCHIP yet, please do it now.

Copy Parsic into the directory of MPLAB (C:\MPLAB)

Start Parsic and load EXAMPLE1.PIC.

Save under  > file > source text save under ... the source text under the name EXAMPLE1.ASM, now.

You can use build, also. The source text is saved here and after that even translated from MPASM.

Start MPLAB.

MPLABTTM version 5.00 or higher.

Variant 1

1.	issue under project -> new project a new project-file with the name EXAMPLE1.PRJ

2.	click development mode -> change

3.	move the microcontroller to 16C84 or 16F84 and MPLAB-SIM simulator.

4.	click in section > Project files < to example1 [.hex]

5.	click Node Properties

6.	choose the following settings in the dialog:

7.	click Add Node

8.	select the assembler-file saved by Parsic

9.	close the dialog

10.	push F10 or Project-> Make Project.

Note:	If you use an INCLUDE-file and you have changed it, you must force the translation with STRG-F10 or project -> Build

Click Picstart-Plus Plus > Enable Programmer.

Select PIC16C84 or PIC16F84.

Click program.

As you have selected MPLAB-SIM simulator you can go through the program with single steps. Therefore you have to push F8 or F7, now.

Variant 2

1.	Push under Parsic-> F10 (build)

2.	Start MPLAB.

3.	Click Picstart-Plus > Enable Programmer.

4.	Select PIC16C84 or PIC16F84.

5.	Click in the main menu on file > Download to Memory.

6.	Select the EXAMPLE1.HEX file created by MPASM (WIN).

7.	In the Picstart-Plus dialog click on program

Useful windows:

Window -> special function register

Window -> stopwatch ...

Window -> new watch window (to show and follow up used variables)

You will find the most important settings of MPLAB under the menu title > Options.

The functions of MPLAB are very extensive and can not be described at this point. Simply try with the development surroundings a little, before you deal with more extensive projects.


 Names

also see Connecting Pin's

Parsic usually allocates the names for objects automatically and numbers these. Under special circumstances, however, it can be required to allocate a solid identifier.

Click with the right mouse button into the object below on the left. Change the first two characters of the name in the dialog. Max. 30 characters for the name are allowed. The first character must be a letter, always.

Example:

The AND-Gate has the name LG12.

Change the name to L1.

Now the name will not be changed by Parsic anymore.

Special names under Parsic

S...	used for signals

Rx, GPx	used for allocate in- and output of the PIC

ADCx	describes an analogue input, where "x" is a number between "0" and "7"

The following names are commands of the Microchip assembler. Parsic accepts the names, but the assembler will create an error message.

ADDLW	SUBLW	MOVWF

ANDLW	XORLW	NOP

CALL	ADDWF	RLF

CLRWDT	ANDWF	RRF

GOTO	CLRF	SUBWF

IORLW	CLRW	SWAPF

MOVLW	COMF	XORWF

OPTION	DECF	BCF

RETFIE	DECFSZ	BSF

RETLW	INCF	BTFSC

RETURN	INCFSZ	BTFSS

SLEEP	IORWF

TRIS	MOVF

Note:	An exact description of the assembler commands you will find e.g. in the quick-reference-guide of MPASM of Microchip.


 Creating objects

Click with the left mouse button on any symbol in the menu bar. Move the mouse into the function-sheet and click at the position you want to place the object.

The right mouse button cancels this function.


 Moving objects

Move a single object

Move the mouse over the object, till the mouse arrow changes into this [image] symbol. Click the with the left mouse button and hold - move it.

To move connecting points, you further have to push <strg> or <ctrl> key.

Moving several objects simultaneously

Variant 1

Press and hold the shift key in place.

Select with the left mouse button the objects which you want to move.

The selected objects changes her outline color into red.

Release the shift key.

Variant 2

Press and hold the shift-key in place.

Click with the left mouse-button to a free area and hold it.

Pull a rectangle around the object you want to select.

Release the mouse-button.

Release the shift-key.

Both variants can also be mixed.

Move with the left mouse-button the object, which is authoritative for you.

Pay attention that other objects will not leave the outside window area.

Cancel selection

Click with the left mouse-button into a free area.


 Deleting objects

Delete a single object

Press the shift-key and hold it.

Click with the left mouse-button on the object to be deleted.

Release the shift-key.

Press the del-key.

Delete several objects

Press the shift-key and hold it.

Click with the left mouse-button into a free area and hold it.

Pull a rectangle around the objects you want to select.

Release the mouse-buttonf.

Release the shift-key.

Press the del-key.


 Connections between objects

Note:	Connections always start at an object-input or output. The junctions are the core of connections.

Therefore the following connections are possible:

1.	Output > junction

2.	junction > junction

3.	Input > junction

Making connection

Click with the left mouse-button on the object-connection and hold it. A blue line appears. You can move this blue line with the mouse.

Parsic always starts with a horizontal line. With the shift-key you can switch between horizontal or vertical.

Signals

Each connection automatically becomes a signal name from Parsic.

If it is necessary to give a connection a fixed name, please click with the right mouse button on an arbitrary junction of the connection.

In the following dialog you enter a signal name which doesn't start with an "S".

Example:

for bit oriented connections: -> S0.3

for byte and word oriented connections: > S7

Cancellation of fixed signal names

for bit oriented connections:

enter a dot for the signal name -> . <-

for byte and word oriented connections:

delete the signal name or enter a -> S <


Settings
 Microcontroller settings

From the menu choose the microcontroller you want to use.

Activate the processor type you want to use.

Choose the oscillator

RC (ext.)	=	The clock frequency is determined by a RC-combination

LP	=	Low-Power, for quartzes or ceramic-swinger of 0 to 200 KHz

XT	=	for quartzes or ceramic-swinger of 200 KHz to 4 MHz

HS	=	High speed, for quartzes or ceramic-swinger 4 to 20 MHz

RC (int.)	=	Internal RC-oscillator, not available at all PIC's

Clock frequency

Enter in the value in Hz, with which the oscillator runs.

Watch-Dog timer

Activated, Parsic automatically insert commands, which reset the WDT regularly. If the program gets stuck, a reset occurred after approx. 18 ms.

Power-On timer

Activated, additional 72 ms maintained after a reset, till the microcontroller starts with the program.

Port-B pull up enable

Activated, each PIN from RBO...RB7 internally get pull-ups, when configured as input.

Brown-Out-Detect

Activated, reset till the supply voltage > 4 V. Useful for a slow rising of the supply voltage to guarantee a sure attempt.

Disadvantage: additional electricity consumption of max. 500 µ A.

MCLR

MCLR	=	MCLR - > normal reset-input

MCLR	=	Input, MCLR int. tied to Vdd. The MCLR-Pin is input (e.g. GP3). MCLR is internally tied to Vcc (+).

Optimize (PIC's with several RAM-Bank's, only)

Activated Parsic insert only commands to the memory bank switching, where it is absolutely required. Otherwise before each access to a variable.

MPLAB-ICD

Activated the following RAM and ROM areas for the MPLAB Incircuit-Debugger kept free (PIC16F87x)

1.	NOP command at address 0.

2.	RAM address $70 and $1EB - 1 EF are not used by Parsic.

3.	The last 256 words of the ROM are not used.

Calibration value

This entry is important for PIC's with internal RC-oscillator and deleting window (JW-types).

This value which has to be entered, is investigated by Microchip during production of the PIC. After a reset this value is written into the OSCCAL-register and takes care, that the internal oscillator runs if possible with 4 MHz. Higher values produce a higher clock frequency.

Note:	Before first programming, this value has to be selected from the PIC. This value is always at the end of the ROM in form of a command. Otherwise this value is lost irrevocably after erasing of the PIC's.

Example PIC12CE519:

The command MOVLW H'84' is at the address $3FF

You must write down "84" and type in at Calibration value.

Code Protected

Activated after programming the PIC can no longer be selected

Note:	At extinguishable PIC-types (JW) with window, it is not possible to reset this Bit with UV ray. The program will be erased, but the PIC cannot reprogrammed.


 Data source

also see: Names

The data source accomplishes several tasks:

1.	Provisioning of variables for own program parts which are tied about the Include object.

2.	Allocation of the analogue/digital transducers at PIC's with A/D.

3.	Definition of constants.

With a click with the right mouse button you can enter an arbitrary value or name.

8 bit

Range of values for constants 0 - 255.

16 bit

Range of values for constants 0 - 65535.

Notes:	It is not allowed to start a signal name with 'S'.

Wires which connected at the data source, always assigned the value, which given the data source as signal name.

At 16 bits a second variable with the ending "_HI" is created, always.


 The multiplexer

Function n to 1

At this function the multiplexer has 2...8 inputs. The inputs, select and the output are 8-Bit broad (Byte). The inputs may also be constant (0-255).

Select-input	Output

0	IN0

1	IN1

2	IN2

etc...

Note:	If the value at select is greater than the number of inputs, nothing happened.

Function 1 to n

At this function the multiplexer has 2 -8 outputs. The outputs, select and the input are 8 bits broad (byte).

Select-input	Output

0	OUT0

1	OUT1

2	OUT2

etc...

Note:	If the value at select is greater than the number of outputs, nothing happened.

Name

The name of the Multiplexer must be clear. (max. 30 characters) and is automatically assigned by Parsic.


 Connecting Pin's

also see Names

In the datasheets of Microchip the connection pin's are marked by RA0, RA1, RA3, RB7, RC6 etc. You will find a little further also the description PORTA, PORTB etc. in principle. Parsic uses the description RX.X or GP.X.

To connect the Pin RB3 with the output of an AND-Gate, you have to click with the right mouse button at the output of the AND-Gate. In the following dialog enter the name RB.3.

Like also at the signals, you can turn over the function of the output or input with a click on the Invert-Button.

As you have placed RB3 on an output of an object now, Parsic will program the PIC RB3 during initialization as an output, also.

Note:	Once output, always output

Unused Pin's are initialized as input..

Special features

RA4	output programmed, it is a Open-Collector type (maybe a pull-up resistor is required)

RB0...7	input programmed, pull-up resistors could be programmed internally

RB0, 4...7	can trigger an Interrupt

The analogue inputs

Take a data source and put it in the active window. Click with the right mouse button on the data source and enter the value e.g. ADC0. From the output of data source you can pull connections to the Schmitt-Trigger or to other objects with a 8-Bit inputs.

The allocation of the A/D channels under Parsic is the following:

Pin	A/D-channel

RA0	ADC0

RA1	ADC1

RA2	ADC2

RA3	ADC3


 RAM and ROM

ROM

Read Only Memory

Read memory, only. The real program is filed in this memory area.

Each command verifies 1 word and is 14 bits broadly (PIC16CXX).

RAM

Random Access Memory

Optional memory access.

In the datasheets it is named as Register File, also.

Signals and variable are stored intermediately during the program flow in this memory.

The PIC16C71 or PIC16C84 has 48 bytes of RAM.

The bytes 0...11 are special register.

The bytes 12...47 are available for signals and variable. (36 bytes)

Note:	Below the menu bar Parsic permanently shows the values needed for the RAM. Under special circumstances the values for the ROM can differ with the words really used up a little.


 Inverter

see AND-Gate


 AND-Gate

also see OR-Gate

The AND-Gate has up to 16 inputs. All inputs and the output can get inverted. At only one input the output gets inverted automatically  = > Inverter.

Name

The name of the gate must be clear. (max. 30 characters) and Parsic is allocating automatically.


 OR-Gate

also see AND-Gate

The OR-Gate has up to 16 inputs. All inputs and the output can get inverted. At only one input the output gets inverted automatically = > Inverter.

Name

The name of the gate must be clear. (max. 30 characters) and Parsic is allocating automatically.


 Timer

also see Mono-Flop

The timer distributes a definite frequency to its output. With the right mouse button the name and the period time can be changed. An error message will follow after invalid input of the period time.

Name

The name of the timing circuit must be clear. (max. 30 characters) and Parsic is allocating automatically.

If a 8 bit variable is indicated for the period time, then the period time is calculated as follows:

(value of the variables (0 -255) x 2 x 256)+program transmission delay of the complete program.

Example

You have typed in the variable ZV1. It describes a counter (ZV1).

At the moment this counter has the value 16.

Than the timer has at present a period time of:

16 x 2 x 256 =  8192 clocks = 8192 µS at 4 MHz plus program transmission delay.

If a 16 bit variable will indicate for the period time, then the period time is calculated as follows:

(value of the variables (0 -65535) x 2 x 256)+program transmission delay of the complete program.


 RS-Flip-Flop

Condition for setting

S = High

R = Low

Condition for reset

R = High

S = High or Low

Inverted in- or outputs turn over the function.

Name

The name of the RS-Flip flop must be clear. (max. 30 characters) and Parsic is allocating automatically.


Mono-Flop and Delay
 Mono-Flop or Delay

also see Timer

Mono-Flop

Depending on input allocation, the Mono-Flop is trigger by a positive or negative edge.

After a click with the right mouse button a dialog for entering appears

1.	Pulse duration in milliseconds or by detail of a variable

2.	Retriggerable or not

3.	The name

4.	Mono-Flop or Delay

5.	Inverted in- or outputs turn over the function.

Suit-Delay

In that moment where the input is put High, the predefined time starts to run. After process of the time the output gets on High.

If the input gets Low before process of the time, the time will be resetted.

Scrap-Delay

In the moment where the input sets High, the output sets High, also. If the input goes Low, the predefined time starts to run. After process of the time the output goes on Low.

If the input gets on High before process of time, the time is resetted.

Name

The name of the Mono-Flop must be clear. (max. 30 characters) and Parsic is allocating automatically.

1.	If you indicate a 8 bit variable for the pulse duration, then the pulse duration is calculated as follows:

(value of the variables (0 -255) x 256)+program transmission delay of the complete program.

Example:

You have entered the variable ZV1. It describes a counter (ZV1).

This counter has the value 16 at the moment.

Then the Mono-Flop got a pulse duration (at present) of:

16 x 256 = 4096 times = 4096 µS at 4 MHz + program transmission delay.

2.	Every Mono-Flop covers 3 Byte in the RAM. The 3rd Byte is used for recognition of the positive or negative edge at the CLK-input. Because of the chronic memory lack at PIC-Processors,  the bits 2-7 still can be used for other signals of this byte.

Example:

Name of the Mono-Flop:

MF1

the following are available:

MF1_FD.2 ... MF1_FD.7


 Counter

also see Up- and Down-counter

The counter  is a 1 byte variable and therefore it can count from 0 -255. The outputs (max. 8) can be distributed on various bits.

Source text is created only for the outputs which have a signal name.

All in- and outputs can get inverted.

Priority has the Reset-Input.

Name

The name of the counter must be clear (max. 30 characters) and Parsic is allocating automatically.


Up- and Down-Counter
 Counter (up and down)

also see Counter

The counter is a 1 byte or 2 byte variable and therefore it can count from 0 -255 or 0 -65535. The outputs (max. 16) can be distributed on various bits.

The QS-Output is the collecting output and can get connected directly with another object with 8 or 16 bit input.

The R/V input determine the counter advance sense.

on low level, the counter counts upwards.

on high level, the counter counts downwards.

Notes:	Source text is created only for outputs which have a signal name.

All in- and outputs (apart from QS) can get inverted.

Priority has the Reset-Input.

Name

The name of the counter must be clear (max. 30 characters) and Parsic is allocating automatically.


 Shiftregister

Every shift-register is a 1 bytes large variable. At every positive or negative impulse at the CLK-input the data starting at Bit 0 are taken over into the shift register.

The output (max. 8) can be distributed to various bits. Source text is created only for outputs which have a signal name.

All in- or outputs can get inverted.

Priority has the Reset-Input.

Name

The name of the counter must be clear. (max. 30 characters) and Parsic is allocating automatically.


 Schmitt-Trigger

Depending on setting the inputs work with 8 bit or 16 bit resolution.

For SP and HY input applies:

The values may be constant or variable

The IN input must be variable.

It it possible to invert the function of the output.

Function

The signal to be measured is given on the IN input.

The SP input defines the upper switching point.

The HY input determines the hysteresis.

The lower switching point is calculated out of SP - HY input.

Example

SP = 100

HY = 20

The output get to high at values > = 100 and at values < (100-20) it get to low.

The hysteresis may never be larger than the switching point.

Name

The name of the Schmitt-Trigger must be clear. (max. 30 characters) and Parsic is allocating automatically.


 Table

The table serves to file fixed values in the ROM.

The access to the table is usually carried out via the CALL-object.

The table is created as subroutine in the ROM.

Type

8-bit	Values in the area 0...255 are filed in the table. The length of the table may lie between 1 and 256

16-bit	Values in the area 0...65535 are filed in the table. The length of the table may lie between 1 and 128. The value is filed in the sequence low byte, high byte in the table.

Processing table

1.	Click with the right mouse button into the table-object.

2.	Give the table a clear name.

3.	Define the length.

4.	Enter the values. With the right scroll bar you reach the remaining values. The counting always starts at 0

During entering the values you are able to vote between different formats, independently to what you have chosen under <display>.

Decimal	all numbers between 0...9 are allowed.

Hexadecimal	with preceding $ the characters 0...9 and A...F are allowed.

Binary	with preceding % the numbers 0 and 1 are allowed. High-order zeros be able to be left out.

ASC	with preceding ' one arbitrary ASC character is allowed.

Save

The contents of the table are saved in the ASC format. One value is written in each line.

Load

The contents of the table came out of an ASC file. A value have to be in each line. Blank lines are ignored. If the type is 8 bits, then higher values are cut off to 8 bits.

Application examples

7 segment decoder

Linearization of analogue values


Call and Subroutines
 Call or Subroutines

The Call object serves to invoke subroutines and tables.

Tables

The contents of the variables at the IN input is the index of the entry in the table.

Example

The table which shall invoked has a length of 16. The contents of variables at IN-Input must lie between 0 and 15. If the value is higher it can be that the PIC executes a reset.

Type

8-bit	The output is a 8 bit variable.

16-bit	The output is a 16 bit variable. This type have to be used accessing 16-bits tables.


 INCLUDE

INCLUDE-files are to embed subroutines and assembler sequences into Parsic. With the right mouse button you can chose, on which place in the created source text the INCLUDE-file will be embedded.

There are 5 positions where INCLUDE-Files can be embedded.

1.	at beginning of the initialization

2.	at the end of the initialization

3.	in the main program

4.	in the interrupt routine

5.	Subroutine

Note:	Embedding in the interrupt-routine,  at minimum, one object with times must be available, otherwise the INCLUDE-File will be ignored.


Impuls-input
 Impulse - Input

With the impulse input the length of an external impulse is determined with a resolution of 16 bits.

For that Parsic uses PORTB change interrupt (RB4..7)

The precision depends on several factors.

1.	The clock frequency

2.	Number of used timers and Mono-Flops.

Note:	many timer-objects or Mono-flops reduce the precision

The time is decided with help of the internal clock frequency. This corresponds with a resolution of 1 microsecond (20 MHz -> 200 nanoseconds) at a 4 MHz quartz.

The length of impulse to be measured must lie between 50 and 65500 times.

The time measurement starts with the positive edge. After the negative edge appears, the time is stored in a variable with the name RBxTIME and RBxTIME_HI.

In the Info-dialog you can adjust, whether the start of measuring shall start at a positive or negative edge.

Notes:	This object is not supported with all microcontrollers.

Further any accesses to the PORTB register (RB.X), should be avoided.


 Impuls-Output, PWM

Impulse-Output

With the impulse-output, impulses can be created with a precision of 16-Bit.

To reach the precision, the remaining program is stopped during the issue.

Only one impulse is created, if the EN-Input lies on high (not inverted).

The time is decided with assistance of the internal clock frequency. This corresponds to a resolution of 1 microseconds (20 MHz = 200 nanoseconds) at a 4 MHz quartz.

The length of the distributed impulse must lie between 50 and 65500 times.

PWM

This object uses the hardware PWM and therefore it is not available at all PIC's.

You can use this module to create analogue tensions.

The output creates a constant output frequency (approx. 4 KHz at 4 MHz clock frequency). The pulse-break- relationship can be changed.

At each positive edge at the CF-Input the value at the upper input is written into duty-cycle-register. The value must lie between 0 and 1023.


 Compare

With the Compare-Object, variables and constants can be compared with each other and in dependence of Bits they could be setted or deleted. The upper (A) variable or constant is always compared with the below (B) variable or constant and accordingly the output is setted on 1 or 0..

The output can get inverted, also.

In the Info-dialog (right mouse button) you can adjust how to compare.

The following possibilities are available

>	greater

>=	greater or equal

=	equal

<=	less or equal

<	less

<>	different

Further you got the possibility to select whether the evaluation shall be carried out with a resolution of 8-bit or 16-bit.

At 16-bit you have to make sure that the source creates 16-bit values, also. Otherwise the assembler creates an error message because of a variable with the ending _HI is missing.


 Arithmetic

All arithmetical functions work without omens. The first operand always stands above.

The following possibilities are available for the selection:

+	Addition

-	Subtraction

x	Multiplication

:	Division

Further you got the possibility to select, whether the evaluation shall be carried out with a resolution of 8 or 16-Bit.

Possible occurring overflows are ignored.

Example

A 16 X 16 multiplication results usually 256. At a resolution of 8-Bit the result is cutted to 8-Bit. The result is 0.

With a division by 0, the result is put on 255 (8 bit) or 65535 (16 bit).


 PIC16C71(1)

Technical data:

Supply voltage:	3...6 V (max. 7.5 V)

Current consumption:	2 mA (4 MHz) 32 µ A (32 KHz)

ROM:	1024 Word (EPROM)

RAM:	36 bytes (PIC16C711 = 68 bytes)

Timer:	1

A/D transducer	1 (4 channel)

In- or Output:	13

Outputs may be loaded up to 25mA (in total 150 mA only)

Brown-Out Detect:	(only PIC16C711)

internal reset at Vdd < 4 V

Advantage	reliable start of the PIC at slow

rising supply voltage:

Disadvantage:	500 µA extra electricity consumption

PIC variants:

PIC16C71-20/JW

erasable EPROM version with window. Working up to 20 MHz, for development

PIC16C71 04/P

version without windows, one time programmable for batch production, up to 4 MHz

PIC16C71 04/SO

version without windows, SMD, one time programmable, up to 4 MHz

Oscillator types

RC	=	The clock frequency determines a RC-Combination

LP	=	Low-Power, for crystal- or ceramic-resonators up to 100 KHz

XT	=	for crystal- or ceramic-resonators up to 4 MHz

HS	=	High speed, for crystal- or ceramic-resonators up to 20 MHz


 Parsic settings

Creating signal names automatically

Activated, signal names are created automatically during connection of objects.

for bit signals > Sx.x

for byte signals > Sx

Ordering windows automatically

Activated, the size of the remaining windows is specified automatically during opening or closing of the windows.

3 D representation

Activated, all objects receives the 3D Look.

Right mouse button center

Activated, a click with the right mouse button moves the view so that this point is the center point of the window. This function is also active during creating, positioning, moving and connecting of objects.

(function-plan, only)

Arrows at sloping connections

Activated, beginning and ending of a connection is marked with arrows, if they don't lie in a right-angle.

Selection without Shift (switch-over)

Activated,  objects can be selected also without assistance of the Shift key.

Right-angle connections

Activated, connections are transferred in the right-angle. With assistance of the Shift key it is possible to switch over the initial direction.

Update simulation

This value determines the interval, with which the data are updated during simulation.

also see simulation


Projekt settings
 Project settings

Created on

Creating-date and -time of the present file can not be changed.

Last amendment

Last saving date and time of the file can not be changed.

Password

If a password is deposit, it is requested during loading of this file. All characters are allowed. Distinguish between large and small initial letters.

Version

Main version

An arbitrary number between 0 and 255 can stay here.

Side version

An arbitrary number between 0 and 255 can stay here, also.

Build

Arbitrary number between 0 and 255.

Increase automatically

If activated, the build version is increased to 1 during saving of the file. At a overflow of 255-> to 256 the build version is put on 0 again and the side version is increased to 1. The main version remains always unchanged.

The main version and the side version typed in the assembler directive "__IDLOCS" . Therefore it is possible to comprehend which program version is "branded" in the PIC.


 GND and Vcc

With the GND and Vcc object it is possible to put unused inputs to a defined level. (e.g. reset at a counter)

Conduction's which are connected at this object gets

GND	always low

Vcc	always high


 Simulation

also see Parsic settings

The simulation can be started and stopped with the button [image].

During simulation it is possible to select inputs with the mouse on high- or low level. This applies also to connections and connection knots, if these aren't pulled by outputs actively on high or low.

8- and 16-Bit connections can also be selected, also but this has no influence to the simulation.

Objects with 8- and 16-Bit functions display the contents by a small window at the object.

How time-dependent objects be simulated depends on the update. You can change this under settings > ambient. Whether this time is adhered depends on the speed of the used PC.

Example:

A Mono-Flop has a fix time of 550 ms. The update stands on 100 milliseconds.

If the Mono-Flop is active, the time increase to 100 ms at each update. This means the output is deactivated only after 6 passes (600ms).

A Mono-Flop with 20 milliseconds would be deactivated after 100 ms only. In this case an update of 10 ms is more exact.

The colors for high- and low level can be defined under settings > colors > simulation.

Note:	INCLUDE files can not be simulated.

Windows which are not opened will not be simulated.


 Label

Labels are competent for the connection of the same signal-names on different function plans.

Parsic provides a clear name. It is possible for you to change this name.

With the right mouse button you reach the dialog for the settings.

You can vote there

1.	whether the label is source or destination

2.	assigning the source label to the destination label.

3.	change the name

To restore the name, allocated by Parsic, simply enter "P:X".

Renaming

If a source label is renamed, all names are changed, also the destination labels.

If a destination label is renamed, nothing happens.

If you change the name of the signals (e.g. S0.7-> M2.3) which are connected by source- and destination  label, then all signals of this "string" are renamed.

Important

Be careful that the source label will have different name. At present Parsic will not check whether a name is already existing.


 EEPROM

With the EEProm-Object it is possible to save the contents of variables in an internal or external EE. This happens at every positive edge at the input of the object.

After a reset the indicated variables are fed again, automatically.

At the selection all present variables are displayed in the left list. All variables which you would like to save must be moved into the right list.

Note:	Pay attention that 16-Bit variable consist of 2 bytes.

Example:

You would like to save the counter reading of the 16-Bit forwards- and backwards counter ZV1.

Then the variables ZV1 and ZV1_HI are shown in the left list. Both variables have to be marked and moved into the right list.

Internal EE

If you meet this selection, the internal EEPROM is used. Not all Microcontroller have an internal EEPROM.

External EE

If you meet this selection, the external EEPROM is used.

Note:	At the first start with a "freshly" burned PIC, the EE contains only $FF values (255). To avoid malfunction you have to use the Limiter or activate the checksum.

Only one external EE-Object is allowed in a project even if Parsic allows several.

Note:	All Microcontroller with the description CE have a built-in external EEPROM (PIC12CExxx, PIC16CExxx).

This EE is mentioned over the II2 bus. Both control lines have got the description SDA and SCL.

SDA

This is the data line of the II2-bus. The connection is of the type Open-Collector. 2 types are already pre-allocated in the selection list:

1.	GPIO.6 = is used for the EEPROM of the Microcontroller PIC12CExxx

2.	EEINTF.6 = is used for the EEPROM of the Microcontroller PIC16CExxx

However, you also can use every other connection. You only have to notice that the description is not Rx.0 resp. GP.X, but PORTx.x resp. GPIO.x.

SCL

This is the clock line of the II2-bus. The connection is a Open-Collector type. 2 types are already pre-allocated in the selection list:

1.	GPIO.7 = is used for the EEPROM of the Microcontroller PIC12CExxx

2.	EEINTF.7 = is used for the EEPROM of the Microcontroller PIC16CExxx

However, you can use every other connection, also. You only have to make sure that the description is not Rx.O resp. GP.x, but PORTx.x resp. GPIO.x.

saving with checksum

If the values are written into the EE, a 1 Byte checksum is created.

If the values are selected after a reset, the checksum is controlled. If it do not match with the calculated values, all variables, which are indicated in the right list, will be initialized with 0.

check after writing (Verify)

After writing of a byte, it is read once again. If it do not match, the writing process is repeated.

Slave address

At the EEPROM type 24Cxx you must indicate the hardware address here. It is determined by the address line A0, A1 and A2 of the EEPROM.

Note:	The default setting is 0.


 Limiter

The limiter checks the contents of the input variables with the upper and lower limit.

If the input > upper limit, then output = upper limit

If the input < lower limit, then output = lower limit

Otherwise:

output  =  input.

For upper and lower limit constants and/or variables are allowed.

error outputs

The Limiter has 2 error outputs.

If the upper limit is exceeded, then the upper output is put.

If the lower limit is fallen below, then the lower output is put.

Using of these outputs is optional. If nothing is connected at them, then Parsic doesn't create any source text either for these outputs.

Type

8 bit:

The input is treated as 8-Bit variable. This applies to the upper and lower limit as well, if they are indicated as variables.

16 bit:

The input is treated as 16-Bbit variable. This applies to the upper and lower limit as well, if they are indicated as variables.


Bit- and Byte-Distributor
 Bit- and Byte-Dispatcher

Function bit -> byte:

Specifically definite bits will be transferred to the output variable.

Hold for this

Output Bit0	=	IN0

Output Bit1	=	IN1

Output Bit2	=	IN2

...

Output Bit15	=	IN15

Notes:	If the number of inputs is  > 8, then the variable at the output is a 16 bit variable.

The inputs don't have to be filled throughout.

For inputs which are not occupied no source text is created.

Function Byte-> Bit:

Definite Bits of the input variable could be transferred specifically to single Bits of the outputs.

Hold for this

OUT0	=	input Bit0

OUT1	=	input Bit1

...

OUT15	=	input Bit15

Notes:	If the number of the output is > 8, then the variable at the input is a 16 bit variable.

The outputs don't have to be filled throughout.

For outputs which are not occupied no source text is created.


LCD-Base - define connections
 LCD module - define connections

All LCD modules, based on the Hitachi HD44780, are supported.

To have enough in- and outputs also at small PIC's, Parsic use only 6 of 11 control lines.

Connected to port (Rx)

Type in at which output port the LCD module is connected. Several LCD modules can be connected parallel. Type in the same port e.g. RB.

Only the bits Rx.0...Rx.4 are used. The bits Rx.5...Rx.7 can furthermore be used as normal in- or outputs.

Connection diagram with 2 LCD modules

Release output (E)

This connection will activate the display if  characters are transferred. Each LDC module needs an own release output e.g. RB.5.

Lines

Put in how many lines the LCD module got. Typical values are 1..4.

Characters per line

Indicate how many characters fit in to a line. Typical values are 8...40.

Process delay

Parsic is waiting app. 50 µ sec after every character till the next character is distributed.

It can be possible that some LCD modules are timed fundamentally slower than mentioned in the datasheets (type 270 KHz). If this applies, not readable characters or character on incorrect positions are issued.

In a low extent you can determine how long the microcontroller shall wait for the transfer of the next character.

Hold for this:

x 1 = approx. 50 µSec. delay.

x 2 = approx. 100 µSec. delay.

x 3 = approx. 150 µSec. delay.

Connection assignment

LCD-Pin	funct.	PIC

1	GND	GND

2	Vcc	Vcc

3	VQ	Poti

4	RS	Rx.4

5	R/W	not used, must tie to GND

6	E	any pin usable

7	D0	not used

8	D1	not used

9	D2	not used

10	D3	not used

11	D4	Rx.0

12	D5	Rx.1

13	D6	Rx.2

14	D7	Rx.3


 LCD module - display text or variable

With this object texts or variable can be distributed on a LCD module. At every edge at the CF-Input, the text or the variable is shown on the predefined position.

Position

Type in the position on which the distributed data shall appear. The left upper corner has the position 0=X and Y= 0. The typed in values, are allowed to be constant or variable (8-Bit).

Output to

Select a LCD module out of this list, on which the text or the variable shall be displayed. The list is empty, if a no LCD-Modul available.

Display text

Enter the text which shall be displayed in the lower editing field. If you leave the editing field empty, a command to delete the display will be created.

Special sign and vowel-mutations must be entered directly as character-code.

At the simulation a '#' is shown instead of a character-code. However, it is possible to indicate a sign which is shown at the simulation.  For the production of source text this sign doesn't have any consequence.

Examples:

ß = #$E2# or #226# or #226,ß#

ä = #$E1# or #225# or #$E1,ä#

ö = #$EF# or #239#

see font HD44780A00

see font HD44780A02

Display variable

In the function plan an additional connection is displayed in the object. At this the signal is connected whose value shall be reported.

The alignment in the display is always flush right.

Display decimal

If it is a 8-Bit variable, then a 3-digit decimal value is displayed.

If it is a 16 bit variable, then a 5-digit decimal value is displayed.

Under > leading zeros you can vote, whether leading zeros shall be shown or replaced by blanks.

If >constant length< is assigned, then the issue is limited on the set length.

Example with length = 2:

If the variable at the input contains a 123, then only 23 are displayed.

If the set length is larger than 3 (8-Bit variable) or 5 (16-Bit variable), then the length is ignored.

Display hexadecimal

If it is a 8-Bit variable, then a 2-digit hexadecimal value is displayed.

If it is a 16-Bit variable, then a 4-digit hexadecimal value is displayed.

Display binary

If it is a 8-Bit variable, then a 8-digit binary value is displayed.

If it is a 16-Bit variable, then a 16-digit binary value is displayed.

Under >leading zeros< you can vote, whether leading zeros shall be shown or replaced by blanks.


 Sleep mode

With this object it is possible to move the microcontroller into the sleep mode.

If the IN-Input lies on high level, then the sleep mode is activated, the program is stopped and the oscillator is switched off.

To restore the normal function 2 possibilities are available.

1.	a positive edge at the RB0-Input

2.	an amendment of level at RB4, RB5, RB6 ... RB7

If the IN-Input remains on high level, the program is passed through one-time and the sleep mode is active, again.

Reductions:

1.	To be able to use this function, the Watch-Dog Timer may not be activated. It would trigger a reset after a particular time.

2.	This function isn't implemented for the Microcontroller type 12C(E) XXX, yet.


 Tool settings

You can configure the main menu tools under this menu item.

To add a program to the menu Tools

Vote add. Parsic shows the dialogue window Tool-Features, in which you can indicate information's about the program you wish to add.

To delete a program from the menu Tools

Select the program, which you would like to delete and push delete.

To change a program in the menu Tools

Select the program you wish to change, and push process. Parsic shows the dialogue window Tool- Features with information's about corresponding program.

Dialogue window tools options

Use this dialogue window to add programs of the menu Tools, to delete or to process.

List field Tools

Lists the programs which are installed in the menu Tools at present.

Adding counters

Click on adding to display the dialog window Tool-Features. In this dialogue window you can indicate the menu name, the path and the initial parameters for the program.

Delete counter

Click on deleting, to delete the presently highlighted program from the menu Tools.

Process counter

Click on process, to display the dialogue window Tool-Features. In this dialogue window process the menu name, the path and the initial parameters for the program.


 Tool features

Use the dialog window Tool features to enter the features of a program out of the menu Tools or to work on these features.

To display the dialogue window Tool features

Click on adding or working in the dialogue window Tools.

Editing field title

Enter the name of the program which you want to add. Then this name appears in the menu Tools.

You can indicate a keyboard abbreviation to the menu command. Enter an and-symbol (&) in front of the letter.

Editing field program

Indicate the place of the program which you would like to add. You can indicate the complete path to your program. Click the search switch to find the path and directory in your drives.

Editing field working directory

Indicate the work directory for your program. Parsic uses a standard working directory, if you select the program name out of editing program. You can change the path, if this is necessary.

Editing field parameter

Enter the start values for the program parameters. For example you would like to submit a file name to your program at the start. Your can type the parameter or/and indicate predefined macros.

Parsic knows three predefined macros.

Macro	Function

$PJT	Refers to the full path of the assembler source of current projects. If you are working in e.g. C:\PROJ1, and you saved the source text under BSP1.ASM, so Parsic submits at program start "C:\PROJ1\BSP1.PJT" to the program.

this macro is for MPLAB

$ASM	Refers to the full path of assembler source of the current project. If you are working e.g. in C:\PROJ1, and your saved the source text under BSP1.ASM, so Parsic submits at program start "C:\PROJ1\BSP1.ASM" to the program.

for compatible assemblers

$HEX	Refers to the full path of the assembler source text of the current project. If you are working e.g. in C:\PROJ1, and the source text is saved under BSP1.ASM, so Parsic submits at program start "C:\PROJ1\BSP1.HEX" to the program.

for programmers

Counter searches

Click on search to select the name for the editing field program. If you click on searches, Parsic opens a dialogue window in which you can select the executable program.


 Object order

Parsic files the single objects in the memory, in the order which they have been placed in the function plan. With a few exception, the source text is created, analoguely.

Under certain circumstances (e.g. INCLUDE-Files) it can be required to change this order.

Simply click on the object name whose position you want to change.

With the counter > forwards < you move the object to the direction create source text earlier.

With the counter > backwards < correspondingly to the direction create source text later.

These objects aren't displayed:

1.	DAT object, if it has the name ADCx . (A/D transducer)

2.	Impulses measuring

3.	Label

4.	Comments


 One-Shot

This object creates an impulse for a program pass.

Function

At every positive edge at the Input the output is setted.

Independently of the status of Input, the output is resetted at the next process, again. (after a program pass).

The input and output also can get inverted.


 UART

also see UART-Data

Universal Asynchronous Receiver Transmitter

With this object you define the settings of the serial interface. Not all microcontrollers have a built-in UART. If you use a PIC without hardware UART, an error message is created.

Baud rate

Vote with which speed the data transmission shall take place.

These values refer to an external clock frequency of 4 MHz.

The format is always 8N1 (8-Bit data, no parity, 1 stop bit)

Self-defined

If no suitable baud rate is available, you can determine the values for the hardware initialization by your self.

If BRGH = 0 then the formula for calculation of the baud rate is:

X =	value for SPBRG, (baud rate council generator must lie between 0 -255)

Fosc =	external clock frequency (type 4 MHz)

Baud rate =	Fosc / (64 (X+1))

or switched over:

(Fosc / 64) / baud rate - 1

If BRGH = 1 then the formula for calculation of the baud rate is:

Baud rate =	Fosc / (16 (X+1))

or switched over:

(Fosc / 16) / baud rate - 1

Example

Baud rate 19200, external clock frequency = 4 MHz, BRGH = 1

SPRG = (4000000 / 16) / 19200 -- 1

SPRG = 250000 / 19200 - 1

SPRG = 13,0208 - 1

SPRG = ~ 12

You must type in the value 12 at SPRG.

Tx-pin

You have to indicate at which Pin the data shall be distributed. If you use UART hardware it is a quite defined connection (type RC.6).

Rx-pin

Here you must say at which pins the data are fed. If you use UART hardware it is a quite defined connection (type RC.7).

Connection example RS232

Connection example RS485

DIR-Pin (only at Half-Duplex)

If the RS485 interface shall be used, this connection switches over the data direction. This output usually lies on low level (reception). If data shall be transferred, this output is set up to high level (send) till the end of the transmission. This happens without consideration whether any object just shall receive data. With help of the active outputs (UART-Data-Objecte), you can influence this process.

with checksum

Activated, a 1 byte checksum is always appended at the end of the transmitted data.

Reception only:

The received checksum is compared with the checksum internally calculated. Only at agreement, the data of the input buffer are transferred into the variables which you indicated in the right list.

The checksum is calculated as follows (CS = checksum):

1.	CS = 170 (HEX = $AA)

2.	CS = CS + 1st byte

3.	CS = CS + 2nd byte

4.	etc..

Example

The 16-Bit counter presently got the value 1000. Then in the right list stands:

ZV5	(contains at present a 232 ($ E8) = low-byte)

ZV5_HI	(contains at present a 3) = high byte)

(3 x 256 + 232 = 1000)

CS = 170 + 232 + 3 = 405 = cut off to the lower 8-Bit = 149

The following byte sequence will be transferred:

<232><3><149>


 UART data

also see UART

With this object data are sent or received about the serial interface.

Active-Output (ACT)

For both function applies:

Transferring

The ACT-Output remains on high level, until the data is transferred..

Receiving

The ACT-Output remains on high level, until the data are correctly received or an error is occurred..

Notes:	With assistance of this output you can prevent that two objects will receive resp. transmit data at the same time.

Parsic uses this output to control the data flow. Well, minimum one interconnecting line must be connected, even if you don't want to use this function.

Function - transfer

All presently created variables are shown in the left list (in the RAM).

Slide all variables which shall be transferred into the right list. The succession in the right list also determines  the succession at transmission.

At a positive edge at the Enable-Input (EN) the output buffer is filled with the indicated variable (+ checksum) and authorized for transmission. Every further edges don't have any consequence, until the transmitting has been finished.

Function - receive

In the left list (in the RAM) all presently indicated variables are shown. Slide all variables into the right list, which shall get the received data.

At a positive edge at the Enable-Input, the input buffer is initialized and authorized for reception. Only such data as indicated in the right list  will be received (every line is 1-Byte). Every further edge doesn't have any consequence till the reception has been ended.

Note:	If errors occurs during reception of data or checksum (if activated), then the reception gets interrupted and the ACT-Output get low level.