WORD variables in Serial Terminal Simulation

#1
Hi everyone,

Yet again I feel stupid not being able to workout how to operate something simple.

I am trying to test some code with the simulator in PE6.

My code...
Code:
blah
blah
blah
SERIN C.3,N4800,W1
Serial Terminal Simulation window pops up when it hits my SERIN line and now I want to have '12345' pop into W1 of the 'Code Explorer' after typing it into the Transmit Buffer.

How on earth do I do this?

With 'Raw' selected, all it has is Transmit Buffer:(e.g "Value=",$25,13,10) as any form of example. But nothing works correctly for me.

I have tried:

"12345"
"Value=12345"

With ASCII selected:
12345

also doesn't work correctly.


Seems like something so damn simple, but ya think I can get the result I want... Nope!




Regards,
Mort.
 

hippy

Technical Support
Staff member
#2
SERIN to a variable without a # only reads byte values, and only stores byte values, even if put into word variables.

Four options -

Either use 'SERIN C.3, N4800, #W1', or 'SERIN C.3,N4800,B3,B2',

Or just replace it with 'LET W1=12345',

Or with 'COUNT C.3,W1' and adjust the value which will be read using the Simulation panel, Values tab, bottom left of PE6.

Useful tip -
Code:
#IfNDef SIMULATING
  SerIn C.3, N4800, w1
#Else
  w1 = 12345
#EndIf
 
#3
SERIN to a variable without a # only reads byte values, and only stores byte values, even if put into word variables.

Four options -

Either use 'SERIN C.3, N4800, #W1', or 'SERIN C.3,N4800,B3,B2',

Or just replace it with 'LET W1=12345',

Or with 'COUNT C.3,W1' and adjust the value which will be read using the Simulation panel, Values tab, bottom left of PE6.

Useful tip -
Code:
#IfNDef SIMULATING
  SerIn C.3, N4800, w1
#Else
  w1 = 12345
#EndIf

Hi Hippy,

Thanks for the reply. I think you misunderstood what I was asking. Basically how can I type 12345 as a WORD variable value into the simulation terminal so that when running a simulation, my SERIN command takes in my number 12345 and puts it into W1 in the Code Explorer.
 

hippy

Technical Support
Staff member
#4
Thanks for the reply. I think you misunderstood what I was asking. Basically how can I type 12345 as a WORD variable value into the simulation terminal so that when running a simulation, my SERIN command takes in my number 12345 and puts it into W1 in the Code Explorer.
You cannot. Your "SERIN C.3,N4800,W1" command will not accept a word value input, in simulation or when running on a real chip.
 
Top