where : ibrtses embedded

The PED32 App wizard

A beginner with this development setup may have troubles finding what is where. The Appwizard overwrites the existing file, so it might be of interest what is added and changed by what setting.

Standard program

After selecting the CPU 8535, and clicking all through, the resulting file is :
program headertest1;

{$NOSHADOW}   (0)
{ $W+ Warnings}            {Warnings off}

Device = 90S8535, VCC=5;

Import SysTick (1);

From System Import (5);

Define
        ProcClock   = 6000000;        {Hertz}
        SysTick     = 10;             {msec}
        StackSize   = $0020, iData;
        FrameSize   = $0010, iData;
        (2)

Implementation

{$IDATA}

{--------------------------------------------------------------}
{ Type Declarations }

type


{--------------------------------------------------------------}
{ Const Declarations }


{--------------------------------------------------------------}
{ Var Declarations }
{$IDATA}


{--------------------------------------------------------------}
{ functions }
(6)


{--------------------------------------------------------------}
{ Main Program }
{$IDATA}

begin
(3)

  EnableInts;
  loop

(4)

  endloop;
end headertest1.
The (x) inserted in bold, denote locations being referred to.

changes to the standard setup

The listed keyword do the described changes to the code at the matching locations. The entries at locations (1),(5) are separated by commas.

Frequency

change (2)
define ProcClock = 6000000; {Hertz}

SystemTick

change (2)
define SysTick = 10; {msec}// fractionals of ms allowed

remove SysTick (=none) : remove SysTick from (1) and from (2)

watchdog

(1)add WatchDog
(2)add WatchDog =0; { fuer 16ms }
                =1; { fuer 32ms }
                =2; { fuer 64ms }
                =3; { fuer 128ms }
                =4; { fuer 256ms }
                =5; { fuer 512ms }
                =6; { fuer 1024ms }
                =7; { fuer 2048ms }
(3)add //  WatchDogStart;
(4)add // WatchDogTrig;

Vcc

change
Device = 90S8535, VCC=5.1;

LongWord

(5)add LongWord

LongInt

(5)add LongInt

Float

(5)add Float

Pipes

(5)add Pipes

PIDs

(5)add PIDs

Stack

change (2)
define StackSize = $0020, iData;

Frame

change(2)
define FrameSize = $0010, iData;

Multitasking

standard : change nothing

safe User Ints : remove (0)  {$NoShadow}

The {$nowshadow} removes the following code (on a Tiny26), which
saves and restores all registers on entry and exit of an interrupt :
 pop R5
 pop R4 
 STS 0070h,R17
 STS 0071h,R16
 In R17,05Fh
 Push R17
 STS 0072h,R19
 STS 0073h,R18
 STS 0074h,R27
 STS 0075h,R26
 STS 0076h,R31
 STS 0077h,R30
 STS 0078h,R21
 STS 0079h,R20
 STS 007Ah,R23
 STS 007Bh,R22
 STS 007Ch,R6
 STS 007Dh,R0
 STS 007Eh,R25
 STS 007Fh,R24
 STS 0080h,R1
 STS 0081h,R2
 STS 0082h,R3
 CLT
 BLD R6,7
 MOV R6,7
 MOV R30,R4
 MOV R31,R5
 IJMP

 LDS R17,0070h
 LDS R16,0071h
 LDS R19,0072h
 LDS R18,0073h
 LDS R27,0074h
 LDS R26,0075h
 LDS R31,0076h
 LDS R30,0077h
 LDS R21,0078h
 LDS R20,0079h
 LDS R23,007Ah
 LDS R22,007Bh
 LDS R6,007Ch
 LDS R0,007Dh
 LDS R25,007Eh
 LDS R24,007Fh
 LDS R1,0081h
 LDS R2,0082h
 LDS R3,0083h
 BRTS +4
 SET
 BLD R6,7
 CLT
 RJMP +2
 SET
 BLD R6,7
 RET
and the minimum program size decreses from 014Ah to 0090h, making a difference of 00BAh, or 186 bytes. There is nothing in between unfortunately. Just save all registers, or save a few only.


MultiTask & Processes : (5)add Processes (2)add Scheduler = iData; (3)add Start_Processes; MultiTask & Tasks : (5)add Tasks (2)add Scheduler = iData; TaskStack = $0020, iData; TaskFrame = $0010; (3)add Start_Processes;

Heap

(1)add Heap
(2)add Heap = iData;
or Heap = $F000..$FFFF; // userdefined as an example

SerialPort

(1)add SerPort
(2)add SerPort     = 2400, Stop1;    {Baud, StopBits|Parity}
       RxBuffer    = 8, iData;
       TxBuffer    = 8, iData;

ADC

(1)add ADCPort
(2)add ADCchans    = 1, iData;
       ADCpresc    = 128;

PWM

(1)add PWMport1
(2)add PWMres      = 8;   {bits}
       PWMpresc    = 64;

(1)add PWMport2
(2)add nothing ??????????????????????????????

Ports

(6)add/change
procedure InitPorts;
begin
PortA:= %00000001; //as example DDRA:= %00000001; //as example PortB:= %00000001; //as example DDRB:= %00000001; //as example PortC:= %00000001; //as example DDRC:= %00000001; //as example PortD:= %00000001; //as example DDRD:= %00000001; //as example end InitPorts; (3)add InitPorts;

SPI

(1)add SPIPort
(2)add SPIbuffer = 8, iData; SPIport = Master; SPIretry = 1; SPIpresc = 0; SPIOrder = MSB; SPICPOL = 1; SPICPHA = 1; (6)add procedure InitPorts; begin end InitPorts;

Graphic LCD

(1) add LCDGraphic 
(5) add From LCDGraphic Import CharSet; {block CharSet, pixels}
(2) add LCDGraphic = 128, 64, 8; {x-pix, y-pix, accesswidth} GViewports = 2, iData; {logical ViewPorts, scalings} DefCharSet = 'Graphchars.pchr';{FileName} TGraphStr = 16; {Graphic Text String Length} (6) add
UserDevice GraphIOS(cmd : byte; adr : word; mask, pixel : byte) : byte; begin (* commands passed to user defined function "GraphIOS" *) (* 0 display init adr = none mask = none pixel = none result = none *) (* 1 display clear adr = fillpatt mask = none pixel = none result = bool *) (* 2 write byte adr = byte adr mask = byte pixel = mode result = none *) (* 3 read byte adr = byte adr mask = none pixel = none result = byte *) (* 4 set pixel adr = byte adr mask = mask pixel = pixel result = none *) (* 5 clear pixel adr = byte adr mask = mask pixel = pixel result = none *) (* 6 xor pixel adr = byte adr mask = mask pixel = pixel result = none *) case cmd of 0 : cmd:= 0; | // display init 1 : cmd:= 0; | // display clear 2 : cmd:= 0; | // write byte 3 : cmd:= 0; | // read byte 4 : cmd:= 0; | // set pixel 5 : cmd:= 0; | // clear pixel 6 : cmd:= 0; | // xor pixel endcase; return(cmd); end;
to be continued ...



Questions ?
Suggestions?
Feedback ?






sponsored links




embedded
home

last updated: 15.june.03



Copyright (2003) Ing.Büro R.Tschaggelar