JP1 Remotes Forum Index JP1 Remotes


FAQFAQ SearchSearch 7 days of topics7 Days MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

Infrared Signals for Beginners
Goto page Previous  1, 2
 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - Protocol Decodes
View previous topic :: View next topic  
Author Message
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 18102
Location: Chicago, IL

PostPosted: Thu May 27, 2010 3:11 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 2844
Location: Cambridge, UK

PostPosted: Fri May 28, 2010 3:25 am    Post subject: Reply with quote

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.

Quote:
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
Back to top
View user's profile Send private message
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 18102
Location: Chicago, IL

PostPosted: Fri May 28, 2010 7:32 am    Post subject: Reply with quote

Quote:
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!
Back to top
View user's profile Send private message Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 2844
Location: Cambridge, UK

PostPosted: Fri May 28, 2010 8:03 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 18102
Location: Chicago, IL

PostPosted: Fri May 28, 2010 9:18 am    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 2844
Location: Cambridge, UK

PostPosted: Fri May 28, 2010 11:56 am    Post subject: Reply with quote

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 Smile ) puts the destination before the source.
____________
Graham
Back to top
View user's profile Send private message
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 18102
Location: Chicago, IL

PostPosted: Fri May 28, 2010 2:02 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message Visit poster's website
jetskier



Joined: 09 Dec 2003
Posts: 278
Location: Minden, Nevada

PostPosted: Fri May 28, 2010 3:53 pm    Post subject: Reply with quote

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

Oh, thanks Rob for figuring this out for my cause.
Back to top
View user's profile Send private message
vickyg2003
Site Admin


Joined: 20 Mar 2004
Posts: 6946
Location: Florida

PostPosted: Fri May 28, 2010 6:11 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
xnappo
Expert


Joined: 30 Dec 2003
Posts: 829

PostPosted: Fri May 28, 2010 8:30 pm    Post subject: Reply with quote

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 10:16 am; edited 1 time in total
Back to top
View user's profile Send private message
The Robman
Site Owner


Joined: 01 Aug 2003
Posts: 18102
Location: Chicago, IL

PostPosted: Fri May 28, 2010 9:56 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 2844
Location: Cambridge, UK

PostPosted: Sat May 29, 2010 3:36 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> JP1 - Protocol Decodes All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

Powered by phpBB © 2001, 2005 phpBB Group
Get Smart! the band's official homepage Rockabilly Central