Infrared Signals for Beginners

If you have learned signals that don't get decoded when you look at them in IR.exe, post your file to the Diagnosis Area then post your question here (including a link to the file).

Moderator: Moderators

The Robman
Site Owner
Posts: 21884
Joined: Fri Aug 01, 2003 9:37 am
Location: Chicago, IL
Contact:

Post by The Robman »

S3C8:
The calls to the $0161 vector appear to set the mid-frame burst to the following settings, then it jumps to the regular engine.

ON: from the ONE pair
OFF: from the leadin pair.

The alternative is to set bit3 in W7 (ie, BITS W7.3) and then call $0146. In this case, the mid-frame burst will be a repeat of the leadin pair.

But, I think I've figured out that you can customize the mid-frame pair by loading the timing data into RD0/RD1(on time) and RD2/RD3(off time).

So, the code would be:
BITS W7.3
ldw RRD0,pd10 (where pd10 is the custom ON time)
ldw RRD2,pd04 (and pd04 is the custom OFF time)
JP 0146h


HCS08:
Here, the following code is used to create a normal mid-frame burst:

MOV #$09, $7D
JMP $FF7A

So, here's what I think the HCS08 version of the custom code would be:

MOV #$09, $7D
BSET 3,$AB
LDHX pd10 (where pd10 is the custom ON time)
STHX $9A
LDHX pd04 (and pd04 is the custom OFF time)
STHX $9C
JMP $FF5F
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
mathdon
Expert
Posts: 4726
Joined: Tue Jul 22, 2008 8:53 am
Location: Cambridge, UK

Post by mathdon »

The Robman wrote:The alternative is to set bit3 in W7 (ie, BITS W7.3) and then call $0146. In this case, the mid-frame burst will be a repeat of the leadin pair.
Do you know the HCS08 equivalent for this? I haven't come across one.
So, here's what I think the HCS08 version of the custom code would be:

MOV #$09, $7D
BSET 3,$AB
LDHX pd10 (where pd10 is the custom ON time)
STHX $9A
LDHX pd04 (and pd04 is the custom OFF time)
STHX $9C
JMP $FF5F
Yes, but the LDHX instructions would need to be LDHX #$xxxx immediate ones. If you actually loaded new values into pd02 and pd0E (the HCS08 locations used by the JMP $FF7A instruction, not pd10 and pd04) then you would also change the actual 1-burst ON time and lead-in OFF time.
_____________
Graham
The Robman
Site Owner
Posts: 21884
Joined: Fri Aug 01, 2003 9:37 am
Location: Chicago, IL
Contact:

Post by The Robman »

BITS W7.3
ldw RRD0,pd10 (where pd10 is the custom ON time)
ldw RRD2,pd04 (and pd04 is the custom OFF time)
JP 0146h
I was trying to economize the code above but it didn't work, I needed to do it the long winded way, as follows:

BITS W7.3
ld w0, #D0h
ld @w0,pd10
inc w0
ld @w0,pd11
inc w0
ld @w0,pd04
inc w0
ld @w0,pd05
JP 0146h

Does anyone know why my shortcut version didn't work?
mathdon wrote:Yes, but the LDHX instructions would need to be LDHX #$xxxx immediate ones. If you actually loaded new values into pd02 and pd0E (the HCS08 locations used by the JMP $FF7A instruction, not pd10 and pd04) then you would also change the actual 1-burst ON time and lead-in OFF time.
I don't know what you mean by "immediate ones" but when I tested the code that I posted above, it worked.
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
mathdon
Expert
Posts: 4726
Joined: Tue Jul 22, 2008 8:53 am
Location: Cambridge, UK

Post by mathdon »

The Robman wrote:I don't know what you mean by "immediate ones" but when I tested the code that I posted above, it worked.
I have great difficulty with S3C8 assembler and no knowledge of how the S3C8 IR engine works, so I can't comment on your code. In the HCS08 engine, if you change the content of pd02 to pd0F you will change the timing of the normal signal bursts. So you need immediate mode addressing (operand is actual data value, not address of data value) to put the mid-frame pair times into $9A-$9D rather than changing the values of pd02 and pd0E and loading $9A-$9D from them.
_____________
Graham
The Robman
Site Owner
Posts: 21884
Joined: Fri Aug 01, 2003 9:37 am
Location: Chicago, IL
Contact:

Post by The Robman »

I'm not changing any of the data in the pdxx registers, I'm using them to format the mid-frame burst. The mid-frame times are +800 -800. I already have a -800 from the times for ONE, so I'm using that for the OFF time. All I'm missing is the +800 as none of the existing pairs use that, so I added it as pd10. There are three bytes of data block data that are not used (ie, pd10,11,12) so I used pd10 and pd11 to hold the +800 time.

LDHX pd10 (this moves data from pd10/11 to x, pd10/11 doesn't change)
STHX $9A (this moves data from x to $9a/$9b)
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
mathdon
Expert
Posts: 4726
Joined: Tue Jul 22, 2008 8:53 am
Location: Cambridge, UK

Post by mathdon »

OK, got it now. I thought you were putting data into the pd locations used by the JMP $FF7A (HCS08) routine, but I see now that you are using otherwise unused pd locations. And of course, as only a rare visitor to the S3C8 world, I had forgotten that S3C8 assembler (perversely :) ) puts the destination before the source.
____________
Graham
The Robman
Site Owner
Posts: 21884
Joined: Fri Aug 01, 2003 9:37 am
Location: Chicago, IL
Contact:

Post by The Robman »

The pd10/11 location was unused, but the pd04 location was already defined as the ONE off time. As the mid-frame burst uses the same off time as the ONE pair, I re-used the location.
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
jetskier
Posts: 287
Joined: Tue Dec 09, 2003 5:58 pm
Location: Nevada

Post by jetskier »

Is this going to be part of the documentation on midframe bursts?

Oh, thanks Rob for figuring this out for my cause.
vickyg2003
Site Admin
Posts: 7104
Joined: Sat Mar 20, 2004 12:19 pm
Location: Florida
Contact:

Post by vickyg2003 »

mathdon wrote: And of course, as only a rare visitor to the S3C8 world, I had forgotten that S3C8 assembler (perversely ) puts the destination before the source.
PERVERSELY is right! I have a heck of a time reading and writing that s3c8 assembler.
Remember to provide feedback to let us know how the problem was solved and share your upgrades.

Tip: When creating an upgrade, always include ALL functions from the oem remote, even if you never plan on assigning them to a button. Complete function lists makes an upgrade more helpful to others.
xnappo
Expert
Posts: 862
Joined: Tue Dec 30, 2003 12:29 pm

Post by xnappo »

vickyg2003 wrote:
mathdon wrote: And of course, as only a rare visitor to the S3C8 world, I had forgotten that S3C8 assembler (perversely ) puts the destination before the source.
PERVERSELY is right! I have a heck of a time reading and writing that s3c8 assembler.
It gladdens my heart that everyone recognizes a good assembly language.

xnappo
Last edited by xnappo on Sat May 29, 2010 9:16 am, edited 1 time in total.
The Robman
Site Owner
Posts: 21884
Joined: Fri Aug 01, 2003 9:37 am
Location: Chicago, IL
Contact:

Post by The Robman »

I've never known any other assembler language other than S3C8 and I only know that one because I learned it "on the job" here in the JP1 world. My professional language is COBOL if you can believe that.

But hey, if you want things backwards, look at the Mits 740 language because it has all the addresses backwards, so $0161 would be $6101 for example.
Rob
www.hifi-remote.com
Please don't PM me with remote questions, post them in the forums so all the experts can help!
mathdon
Expert
Posts: 4726
Joined: Tue Jul 22, 2008 8:53 am
Location: Cambridge, UK

Post by mathdon »

xnappo wrote:It gladdens my heart that everyone recognizes a good assembly language.
It's not just the assembly language that is better for the HCS08, it's the architecture. Simple and elegant. The S3C8 architecture, on the other hand, is mind-blowingly complex and weird - to me, at any rate. I must admit that I start with a bias towards HCS08 assembler as it is so similar to that of the 6502 for which I spent many happy hours of assembler programming in years long past. But I really don't think that's the reason I prefer it. I'm sure that coming afresh to both of them, I would judge the HCS08 architecture and assembler to be far the best of the two.
______________
Graham
Post Reply