Author Topic: Problems with Port $2A  (Read 4955 times)

0 Members and 1 Guest are viewing this topic.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Problems with Port $2A
« on: August 28, 2011, 12:11:19 am »
I'm trying to use this SafeCopy routine with port $2A when port $20 is set to 1.  However, I get problems that normally occur when one doesn't delay long enough for the LCD.  In other words, the delay port doesn't seem to be working.  Any suggestions?

Code: [Select]

safecopy2:
ld a, $87
out ($2A), a
ld c,$10
ld a,$80
setrow:
nop
nop
nop
nop
nop
;in b,(c)
;rl b
;jp c,setrow
out ($10),a
ld de,12
ld a,$20
col:
;in b,(c)
;rl b
;jp c,col
nop
nop
nop
nop
out ($10),a
push af
inc c
ld b,64
row:

rowwait:
;in a,($10)
;rla
;jp c,rowwait
ld a, (hl)
out (c), a
add hl,de
djnz rowwait
pop af
dec h
dec h
dec h
dec c
inc hl
inc a
cp $2c
jp nz,col

ret


Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Problems with Port $2A
« Reply #1 on: August 28, 2011, 12:27:48 am »
Keep in mind that when you set 15MHz, you need a longer delay (in terms of cycles) because each cycle is shorter.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Problems with Port $2A
« Reply #2 on: August 28, 2011, 12:51:39 am »
Like calc84 said, you need quite a few cycles of delay in 15Mhz mode. To cover all LCDs, you'll probably have to get an upper range of 180 cycles per loop with your average lcd running at 150 cycles.

Your $87 gets divided by 4 and only comes out to 33 cycles. That plus your current 43 only leaves you with 76, and that is nowhere even close to what you need.

Try getting your main loop up somewhere around 120 and setting (2Ah) to $FF. That should give you 183 and will definitely work. From there, you can scale it down to your needs. However, you can't go lower than 123, but, that's ok I guess.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Problems with Port $2A
« Reply #3 on: August 28, 2011, 10:13:49 am »
Oh, gotcha.  My problem was I thought the upper six bits was the number of clock cycles (1 cycle = 4 T-States) rather than the number of T-states
« Last Edit: August 28, 2011, 10:14:04 am by Hot_Dog »

Offline Monkeyanator

  • LV0 Newcomer (Next: 5)
  • Posts: 3
  • Rating: +0/-0
    • View Profile
Re: Problems with Port $2A
« Reply #4 on: August 28, 2011, 11:22:47 am »
Hey, I don't know anything about calculator programming. I know C++, Objective C, and Adobe AS3 all fairly well... but I am completetly foreign to what you use to code for calculators. In fact, I don't even know what you use to code for it! I really need some help... can someone PM me? I really want to get started with it.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Problems with Port $2A
« Reply #5 on: August 28, 2011, 11:37:05 am »
Monkeyanator, you have made 3 posts in various topics that are all similar, the most recent two being exactly the same. If you are not a spambot, and are just very confused, then please delete your other two posts and create a topic introducing yourself via this link.
Edit: And on a less threatening note, welcome to Omnimaga! :)
« Last Edit: August 28, 2011, 11:40:41 am by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.