Stimulation File for HC908QY4 using CW 5.1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Stimulation File for HC908QY4 using CW 5.1

3,172 Views
Autotecnic
Contributor I

Hello everyone, i´m trying to debug one of my proyects based on HC908QY4 and using CW V5.1 special edition. I already managed to define a visualization tool with one led and one switch asociated to an output pin and one input pin of my project. That worked ok.

Now i want to create a stimulation file to replace the switch input, but i found very litle documentation about it.
In help file it talks about iodemo.abs, but i don´t know where this demo is located ???

So i used the example below, shown in the help and adapt to my project :

/* Define an identifier a, which is located at address 0x210*/

/* This identifier is 1 Byte wide.*/

def a = TargetObject.#210.B;

/* After 200 000 cycles have expired, repeat 50 time */

/* the code sequence specified between the keywords */

/* PERIODICAl and END. */

PERIODICAL 200000, 50:

     50000 a = 128; /* After 50 000 cycles, write 128 at address 0x210. */

    150000 a = 4;   /* After 150 000 cycles, write 4 at address 0x210. */

END

10000000 a = 0; /* After 10 000 000 cycles, write 0 at address 0x210. */

I changed 0X210 for my PortA data register (0X0) . DDRA was set to input on bit 0. Load this file in stimulation component, run .. but nothing happens. No changes in memory locations for PORTA. I also  atached a led component to the same port , but i see no change.

I also read this doc : \Help\pdf\Debugger_HC08.pdf but it talks nothing about this.

I would apreciate any detailed help on how to create a stimulation file and make it to work with my project May be a link to a working example so i can learn. i found very litle explanation on this powerfull tool. !!

Regards


Message Edited by J2MEJediMaster on 2007-06-19 09:59 AM
Labels (1)
0 Kudos
4 Replies

414 Views
Autotecnic
Contributor I
Ok, i´ll work based on your example, thanks very much for your help.

Regards
0 Kudos

414 Views
Autotecnic
Contributor I
Hello, CrazyCat , thanks for your time, i understand now i must use a command file to do that.
Up to now i used the comand window with the input <x> <n>  command to change the state of my PORTA bit 0, and that is ok, but now i would like to make my input change  form  0 to 1 and back to 0 with a period of 1 sec. for ex.  Don´t figure how to make the delay and in general the syntax of the file.

Would you be so kind to post a short example of how the command file would look (syntax) and how to save and call later in my debug session ??

Thanks again for your time.

Sorry if i´m not to clear it´s because english is not my first language.
0 Kudos

414 Views
CrasyCat
Specialist III
Hello
 
Basically you need to use the command wait to define a delay and then either a for or while loop to implement the loop.
 
For example:
 
Code:
DEFINE loop = 0WHILE loop < 1000 DEFINE loop = loop + 1  INPUTA 1  // Write 0x1 to PORTA  WAIT 10   // Wait 1 second  INPUT 0   // Write 0 to PORTA  WAIT 10   // Wait 1 Second ENDWHILE

 
 
CrasyCat
0 Kudos

414 Views
CrasyCat
Specialist III
Hello
 
Stimulation component is not available with HC08 Full Chip simulator.
So you will not be able to use it at all with that connection.
 
If you wish to stimulate input on an I/O port, you can use a command file and the corresponding simulator commands.
 
Please refer to the manual {Install}\Help\PDF\Debugger_HC08.pdf Chapter ""Book V - Commands for general purpose debugger commands.
 
Refer to Chapter "Book II - HC08 Debug Connections" section "HC08 Full Chip Simulation" -> "Configuration Procedure" -> "Peripheral Modules Options" for simulator specific commands.
 
I hope this helps.
 
CrasyCat
0 Kudos