Demo-1  <<--BACK         HOME            UP --^           NEXT-->>  Demo-3
side4linux, a simple integrated development environment!

AVRC Demo-2  How to use side4linux to make your own Product.


Requirements:
Purpose: 
To demonstrate how to add a new Product to the directory tree we will show you how to make a new Product based on an Atmel AVR Atiny13 chip.
This chip has limited facilities so download the
Atmel PDF for the Atmel AVR Atiny13 chip
(Local) and keep it close by for reference.
We will not be filling in the detail for this Project other than describing it verbally as this Demo is only about setting up a new Product and then adding Projects to it. For more detail on areas glossed over please refer to other sections of the Help!

Description:
This Product will be a temperature controller that senses temperature with a thermistor (R1), a type of resistor that has a negative resistance co-efficient that changes down to a lower value of resistance as the temperature increases. This varistor will be part of a circuit with another fixed resistor (R2) that forms a voltage divider network. Hence as the temperature goes up the voltage will go up as well. We will connect the output from this divider network to the Atiny13 chip and read it's value onboard using the internal ten bit ( 1024 bits ) analog to digital converter. We will monitor this ADC value in software and turn a light emitting diode on and off via a port line (PB0) as the temperature goes above and below our 'set point'. Please refer to the circuit below to understand the schematic detail.

Schematic diagram

Further Requirements:
Pre-Requisites:


Step-1: Create the 'DemoProduct' Product.

In side4linux all the Projects used in creating a Product are kept in the one 'Product' folder.
The 'Product' folder is then stored in one of three 'Product Areas'. The three 'Product Areas' are,
  1. PRODUCTS --Products that you will be making.
  2. TOOLS -- Programs to do utility things such as the side4linux IDE.
  3. DEMOS -- Examples to be used for tuition or demonstration.
Open the side4linux IDE and click on  'Project>NewProduct'  you should see the New Product Dialog as shown in figure-1 below,

New Product Dialog
Fig-1 Create the 'DemoProduct' Product.

Change the Product Name 'NewProduct' to 'Tswitch'.

We are already selected for the 'PRODUCTS' Product type as we are not creating a 'TOOL' or 'DEMO' Product, so  left click on 'Apply'.
The 'Tswitch' Product has now been created in the '
PRODUCTS' Product Area folder so now we must populate the Product 'Tswitch' with Projects.

For this example we will provide an empty printed circuit board Project and an empty 'AVRC' 'C' Project which would contain the program code if this Product was real.



Step-2: Create the printed circuit board Project for the 'Tswitch' Product.

Now we need a printed circuit board for our new Product. To do this we will set up a 'PCBS' Project for t
he 'Tswitch' Product to create the circuit schematic and the printed circuit board. Click on 'Project>New Project' in the IDE and select the Printed Circuit project type from the Dialog as shown in figure-2 below,

Project Type Dialog
Fig-2 Select new Project type.

Clicking on 'Next' brings up the Product Area Selection Dialog as follows in figure-3,

Select Product Area Dialog
Fig-3 Choose the Product Area to place the new Project.

As we are going to select from the 'PRODUCTS' Product Area we will leave the Radio Button on 'PRODUCTS' so now left click the 'OK' button and you should see the Product Select Dialog shown in figure-4 below,

Select Product Dialog
Fig-4 Select Product Folder to place the new Project into.

Click on the 'Combo Box' and select our new Product 'Tswitch' then cleft click the 'Next' button to enter the new board's Project Name 'tboard' as in figure-5 below,

Enter New Project Name Dialog
Fig-5 Enter New Project Name Dialog

Notice that the new Project will be saved to the 'PCBS' Project folder within the new
'Tswitch' Product.
Now click on 'Build' to create the 'tboard' Project.

Click on the 'Open-SCH' Toolbar Button and open 'power.sch' to see the empty schematic file, suitably labelled in the bottom right hand corner.
Close the schematic as we are leaving it empty.

Click on 'Project>CloseProject' in the IDE to close our 'tboard' pcb project as we will now create the software to run on it.
Refer to the 'PCBS' section of the Help for information on creating printed circuit boards using the side4linux IDE.


Step-3: Create and build the 'C' software for the Product.

Click on 'Project>New Project' in the IDE and select "AVR 'C' Program" as shown in figure-6 below,

Select 'C' Project
Fig-6 Select new AVR 'C' Project

Clicking on 'Next' brings up the Product Area Selection Dialog as follows in figure-7,

Select Product Area Dialog
Fig-7 Choose the Product Area to place the new Project.

As we are going to select from the 'PRODUCTS' Product Area we will leave the Radio Button on 'PRODUCTS' so now left click the 'OK' button and you should see the Product Select Dialog shown in figure-8 below,

Select Product Dialog
Fig-8 Select Product Folder to place the new Project into.

Click on the 'Combo Box' and select our new Product 'Tswitch' then cleft click the 'Next' button to enter the new 'C' software's Project Name 'tprogram' as in figure-9 below,

Enter New 'C' Project Name Dialog
Fig-9 Enter New 'C' Project Name Dialog

Notice that the new 'C' software Project will be saved to the 'AVRC' Project folder within the new 'Tswitch' Product.

Click on 'Build' to create the 'tprogram' Project and you will be greeted with the following Dialog shown in figure-10 below,

Opening AVRC Project Properties
Fig-10 Opening AVRC Project Properties

Change these Project Properties as follows,
  1. Click on the 'Combo Box' on the top right and select 'attiny13'
  2. Alter the crystal frequency to 9.6 MHz.
As shown in figure-11 below,

New AVRC Project Properties
Fig-11 New AVRC Project Properties

Click on the 'Apply' Button to complete the Build of the new Project.
( You can change this later if need be 'Project>Edit Project Properties' ).

Notice that the 'Project-Name/Chip-Type/Crystal-Frequency' in the bottom left Status Bar Box is 'P:Tprogram/attiny13/9.6000'
Notice that the next Status Bar Box is 'Ptype: AVRC'

Click on the 'Open-TXT' Toolbar Button in the IDE and open both 'main.c' and 'main.h' files.

Notice the line ' #define F_CPU 16.000000     // tell your chip the Xtal frequency! ' in main.h
You need to change this to 9.6 to complete the setting of the crystal frequency as the IDE is not allowed to alter this file!

Click on Build ( presumes you have either the AVRCsupport installed or your Distribution's Packages ) and see if
the third Status Bar Box is saying 'Pbuild: OK!' if not then read 'setup AVR-GCC build environment' (local) or,
if you are using the side4linuxDVD try reading Demo-0 (Local DVD) again.

Click on 'Project>CloseProject' in the IDE to close our 'Tprogram' software project.

Step-5: Summary of Product creation using side4linux.
Congratulations if you have got this far as this is the end of Demo-2!



In Demo-3 .


We will provide other demos as 'side4linux' develops to cover integration into a real world machine controller.