#garfield Logs

Apr 18 2021

#garfield Calendar

12:37 AM rue_mohr: my "key up" code is not working, it must be doing something conceptually wrong
12:46 AM rue_mohr: its not returning untill all the keys are up
12:48 AM rue_mohr: STILLKEY:
12:49 AM rue_mohr: LD BC,#0x3000
12:49 AM rue_mohr: NOISEKEY:
12:49 AM rue_mohr: IN A,(C)
12:49 AM rue_mohr: CP LastInkey_OFF(IY)
12:49 AM rue_mohr: JP Z,STILLKEY
12:49 AM rue_mohr:
12:49 AM rue_mohr: CALL LONGDELAY ; BREAK BOUNCE DELAY
12:49 AM rue_mohr: INC C
12:49 AM rue_mohr: JP NC, NOISEKEY
12:49 AM rue_mohr: the keyboard is address 3000 to 3FFF, so I use the lower part of the address for some debounce counts
12:49 AM rue_mohr: when the counter hits 3100, it returns
12:51 AM rue_mohr: I'v checked the memory location, its right
12:57 AM rue_mohr: oh I bet I know
12:57 AM rue_mohr: I bet inc doesn't set flags
12:58 AM rue_mohr: !#$!@#%!@#%$
12:58 AM rue_mohr: C: Not affected
12:58 AM rue_mohr: I'll have to roll it over to zero then
01:01 AM rue_mohr: I suppose I could add 1, it doesn't have to be efficient, but watching for it being zero is just fine too
01:14 AM rue_mohr: looks like I have an errata
01:14 AM rue_mohr: in my book
01:14 AM rue_mohr: this book is getting demoted rapidly, this isn't the first error
01:28 AM rue_mohr: yup, I'm confused
01:49 AM rue_mohr: huh
01:49 AM rue_mohr: looks like I have another issue
01:49 AM rue_mohr: my delay it WAY longer than exptected
01:52 AM rue_mohr: INC C ; debounce counter
01:52 AM rue_mohr: JP NC, KEYTEST ; not charged yet.
01:52 AM rue_mohr: there I did it again
01:52 AM rue_mohr: ugh
02:21 AM rue_mohr: that works way better
02:22 AM rue_mohr: 16k rom is about 33% full
02:58 AM rue_mohr: the screen I have holds 160 chars
02:58 AM rue_mohr: if I make a full-on buffer for it, and use my scratch space, I'll have 96 bytes left
02:58 AM rue_mohr: of which I'm already using 6
02:59 AM rue_mohr: so there would be room for 90 more
02:59 AM rue_mohr: I was using 5 in 1995
02:59 AM rue_mohr: in 26 years, I'v added 1 byte
03:00 AM rue_mohr: at this rate, in 2340 years, I will have run it out of memory
03:00 AM rue_mohr: (for that 256 byte page)
10:54 AM rue_mohr: so yea
11:01 AM rue_mohr: my assumption that increment would set the carry flag really messed up my debouncing code
11:01 AM rue_mohr: I can use the z flag, it happens at the same time
11:02 AM rue_mohr: the commands so far are
11:03 AM rue_mohr: r for read, w for write, i for increment address, d for decrement address, g for goto user program, and p for program rom
11:03 AM Tom_L: local forecast shows snow on Tues
11:03 AM rue_mohr: yep, it sure teases eh?
11:03 AM rue_mohr: do you have summer like weather now?
11:04 AM Tom_L: it's sunny and chilly but nice today
11:04 AM Tom_L: we had 80's previously
11:04 AM rue_mohr: we have sunny and warm, I dont trust it a bit
11:05 AM Tom_L: been a slow starting spring
11:05 AM Tom_L: sometimes it just goes from cold to hot
11:06 AM Tom_L: been looking over cutters a bit this AM https://www.lakeshorecarbide.com/tasrougher.aspx
11:06 AM Tom_L: those look nice
11:08 AM Tom_L: for quick material removal
11:08 AM rue_mohr: indeed.
11:09 AM rue_mohr: you want to shred some billets eh?
11:10 AM Tom_L: might lighten the load on material removal
11:10 AM rue_mohr: the z80 has some awkwardness around the A register
11:10 AM Tom_L: you generally don't find roughing endmills that small
11:10 AM rue_mohr: its the ONLY register you can do math with
11:11 AM Tom_L: odd
11:11 AM rue_mohr: and yet, its kinda the register you naturally pass arguments with
11:11 AM rue_mohr: the z80 is quite pointer-centric
11:11 AM rue_mohr: it would actually be eaiser to put the value in memory to pass it to a function
11:11 AM Tom_L: you're really gettin into this one bit two bit rom stuff
11:12 AM rue_mohr: not layerable tho
11:12 AM rue_mohr: I hope I'm on to something else soon
11:12 AM rue_mohr: not that I dont want to work on this, but I'd rather finish up thing like the big cnc
11:13 AM rue_mohr: just not into a mode to attack that right now tho
11:13 AM rue_mohr: what size bit were you looking at?
11:14 AM rue_mohr: those get pricey fast
11:14 AM Tom_L: she's been in class 8-5 Sat-Sun lately, you'd think i could come up with something to make
11:14 AM Tom_L: carbide is expensive but lasts long
11:14 AM Tom_L: .250 probably
11:14 AM rue_mohr: it all breaks the same :)
11:14 AM Tom_L: and they have some corner endmills that are nice
11:14 AM rue_mohr: when you forget to turn on the spindle...
11:14 AM Tom_L: https://www.lakeshorecarbide.com/cornerroundingcutters.aspx
11:15 AM Tom_L: dealing with cutters like this, you forget nothing
11:15 AM rue_mohr: mhm
11:15 AM Tom_L: i got a few of those smaller ones
11:15 AM rue_mohr: ok, whats another word for repeat that doesn't start with r
11:15 AM rue_mohr: do-over?
11:16 AM Tom_L: no, that indicates a mistake
11:16 AM rue_mohr: already using d too >:/
11:16 AM rue_mohr: well, sometimes you type wrong
11:16 AM Tom_L: say again?
11:16 AM Tom_L: do again?
11:16 AM rue_mohr: maybe if I just make backapace work
11:16 AM rue_mohr: but I cant control the cursor position on the screen yet
11:17 AM rue_mohr: everything is unfinished
11:17 AM Tom_L: you finished the blast cage
11:17 AM rue_mohr: right now the screen wraps, I want to make it scroll
11:17 AM rue_mohr: used the cage too!
11:17 AM rue_mohr: and the adapter
11:17 AM Tom_L: make a list today of things you finished
11:18 AM Tom_L: make another list of unfinished
11:18 AM Tom_L: see which is longer
11:18 AM rue_mohr: do I have to finish the list?
11:18 AM Tom_L: yes
11:18 AM rue_mohr: toilet is in
11:18 AM Tom_L: draw a line in the sand and start back from that
11:18 AM rue_mohr: tho I'v not taken the old one to the landfill
11:18 AM rue_mohr: had to do that yesterday, and yesterday got complicated
11:19 AM rue_mohr: I did, but it was drawn back around 1985 and its going to take me a while
11:19 AM rue_mohr: I'm at 1995 now
11:19 AM Tom_L: put the old one in the garden and fill it with flowers
11:20 AM rue_mohr: after the traumatizing experience trying to get a keystroke from a linux console I' need its simplicity
11:21 AM rue_mohr: I suppose the problem starts when you try to make something adhere to multiple standards
11:22 AM rue_mohr: a thing doing a bad job, is a thing that does a good job when applied to what it was designed for.
11:31 AM Tom_L: another
11:32 AM Tom_L: copy
11:32 AM Tom_L: ditto
11:32 AM Tom_L: echo
11:32 AM Tom_L: duplicate
11:39 AM rue_mohr: :)
11:47 AM Tom_L: you can get your co'workers with this...
11:47 AM Tom_L: i was gonna tell you a joke about a roof....
11:47 AM Tom_L:
11:48 AM Tom_L: but it was over your head
11:48 AM rue_mohr: HAH
11:48 AM rue_mohr: sorry, assembler is capslock..
11:49 AM Tom_L: i went by the copier this morning and heard music coming from it....
11:49 AM Tom_L: turns out it was just a paper jam
11:49 AM rue_mohr: hah
11:52 AM Tom_L: if you're not supposed to abuse cough syrup, why does it come with it's own shot glass?
11:53 AM rue_mohr: hm
11:55 AM rue_mohr: HUH
11:56 AM rue_mohr: you can directly load static values into memory using the ix/iy pointers
11:56 AM Tom_L: handy
11:57 AM rue_mohr: its interesting trying to work out how the intended the processor to be used
11:58 AM rue_mohr: ;LD A,#0xFF
11:58 AM rue_mohr: ;LD (RWMode),A
11:58 AM rue_mohr: same as
11:58 AM rue_mohr: LD RWMode_OFF(IY),0xFF
11:58 AM rue_mohr: (with iy already set up)
11:58 AM rue_mohr: but with the latter you dont clobber that A register
12:01 PM rue_mohr: I'm gonna wear out this poor flash chip
12:02 PM Tom_L: they didn't have as many flash cycles back then
12:02 PM rue_mohr: no, and its a used chip
12:02 PM Tom_L: but likely only once before you got it
12:02 PM rue_mohr: yes, I suppose
12:04 PM rue_mohr: hahah damn this instruction book!
12:05 PM rue_mohr: I THOUGHT there were software interrupts, but its not mentioned in the body of the book
12:05 PM rue_mohr: looking thru the index and there they are!!!
12:05 PM rue_mohr: ARG
12:05 PM rue_mohr: this is the second time the body of the book skipped an instruction
12:07 PM Tom_L: z80?
12:08 PM Tom_L: http://www.z80.info/1653.htm
12:09 PM rue_mohr: there is lots of z80 out there
12:09 PM rue_mohr: I have an old paper zilog manual
12:09 PM rue_mohr: er
12:09 PM rue_mohr: mostek
12:09 PM rue_mohr: anyhow
12:09 PM Tom_L: i should send you my 68HC11 books
12:09 PM Tom_L: and 38332
12:10 PM rue_mohr: I have one from school (hc11)
12:10 PM Tom_L: that's a 9 or 10 set
12:10 PM rue_mohr: never worked out a purpose for it
12:10 PM Tom_L: 2 pink books
12:10 PM rue_mohr: I need to open my mind to using things for one-off-miscelanious tasks
12:10 PM Tom_L: 68332*
12:11 PM rue_mohr: what package is the 68332?
12:12 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/maxbot/image023.jpg
12:13 PM rue_mohr: oo high io
12:13 PM Tom_L: 132 pin?
12:16 PM Tom_L: got a spare board too...
12:18 PM rue_mohr: ok, shower, food, and sunshine (while is lasts)
01:09 PM aandrew: 144 is my guess
01:09 PM rue_mohr: shower done, food is burning, sun is... sunning
01:09 PM rue_mohr: and I am coding
01:10 PM rue_mohr: :) I have the reset vector table written out now!
01:10 PM rue_mohr: .ORG 0X00
01:10 PM rue_mohr: JR INIT
01:10 PM rue_mohr:
01:10 PM rue_mohr: .ORG 0X08
01:10 PM rue_mohr: JR INIT
01:10 PM rue_mohr:
01:10 PM rue_mohr: .ORG 0X10
01:10 PM rue_mohr: JR INIT
01:10 PM rue_mohr:
01:10 PM rue_mohr: .ORG 0X18
01:10 PM rue_mohr: JR INIT
01:10 PM rue_mohr:
01:10 PM rue_mohr: .ORG 0X20
01:10 PM rue_mohr: JR INIT
01:10 PM rue_mohr:
01:10 PM rue_mohr: .ORG 0X28
01:10 PM rue_mohr: JR INIT
01:10 PM rue_mohr:
01:10 PM rue_mohr: .ORG 0X30
01:10 PM rue_mohr: JR INIT
01:10 PM rue_mohr:
01:10 PM rue_mohr: .ORG 0X38
01:10 PM rue_mohr: JR INIT
01:10 PM rue_mohr:
01:10 PM rue_mohr: .ORG 0X66
01:10 PM rue_mohr: JR INIT
01:11 PM aandrew: JR?
01:12 PM aandrew: Wouldn’t you want them unconditional jumps?
01:13 PM rue_mohr: jump relative
01:13 PM rue_mohr: smaller jump, its just an offset
01:14 PM rue_mohr: the hardware interrupt thing I came up with is much more efficient at doing the function table lookups than it would be to otherwise code it out tho
01:15 PM rue_mohr: If I'm going to progress with this code, I'm going to need macros
01:16 PM rue_mohr: not sure what they have for that in here yet
01:16 PM rue_mohr: sdasz80
01:26 PM rue_mohr: hahah I keep trying to use jmp instead of jp
01:35 PM rue_mohr: sweet, using the interrupt table and the restart command, I dont have to magically know the address of the dynamic function function
01:41 PM rue_mohr: nice
01:42 PM rue_mohr: ok, so I need to work on the screen functionality and then make it a bit more editor like
01:44 PM rue_mohr: I suppose I can make it like a hex editor
01:44 PM rue_mohr: where you scroll thru memory like a file
01:44 PM rue_mohr: you can position the cursor and edit values
01:44 PM rue_mohr: F5 for refresh
01:45 PM rue_mohr: or soemthing, I need to ponder
01:45 PM rue_mohr: the use of the screen like that is totally different
01:45 PM rue_mohr: almost straight into writing to a render buffer and doing a blit
01:46 PM rue_mohr: and then positioning the cursor...
01:46 PM Tom_L: hey now.. wait just a min
01:46 PM Tom_L: aren't you already working on one editor!
01:46 PM rue_mohr: that editor is the reason for me wanting to work on this
01:47 PM Tom_L: the snowball just gets bigger
01:47 PM rue_mohr: yes
01:47 PM rue_mohr: hahah I cant fit 16 values per line
01:47 PM rue_mohr: ok
01:47 PM rue_mohr: I can do 8
01:48 PM rue_mohr: 0000: FF FF FF FF FF FF FF FF ........
01:48 PM rue_mohr: the screen is only 40 wide
01:48 PM rue_mohr: 16 requires like a min or 52 chars
02:46 PM aandrew: smaller fonts
03:08 PM Tom_L: ok one kbd R & R and cleaned
03:08 PM Tom_L: after a juice spill
03:36 PM Tom_L: ok kbd #2 cleaned
03:36 PM Tom_L: (it was a bad spill)
06:11 PM polprog: finished editing part 1 of the sound blaster video
06:11 PM rue_mohr: :)
06:31 PM polprog: so as it turns out, these high voltage generators i got from aliexpress, have the other end of the winding in the transformer
06:31 PM polprog: its not connected to the PCB, but if i connected it, and added a seconf HV diode and cap, I would get the symmetric -HV output
06:31 PM polprog: (50-390V)
07:02 PM rue_mohr: :)
07:17 PM rue_mohr: I suppose if I'm trying to develop on that z80 system a serial port for being able to bulk load software is a great step
07:17 PM rue_mohr: along with a memory move and memory copy command
07:23 PM rue_mohr: so the z80 uart is an issue
07:24 PM rue_mohr: I dont want to drop in another 40 pin dip
07:24 PM rue_mohr: but the smaller uarts lack two things
07:24 PM rue_mohr: - baud rate divider
07:24 PM rue_mohr: - automatic flow control
07:25 PM rue_mohr: I have some QFP 16550s
07:25 PM rue_mohr: but I cant make them into a dip narrower than 0.8"
07:25 PM rue_mohr: which means custom socket
07:28 PM rue_mohr: ok, well, I had realestate plans for it, I should look them up
07:28 PM rue_mohr: some other things have changed anyhow
07:40 PM rue_mohr: ok, wait, 8251 has a rx buff empty pin thats automatic
08:09 PM aandrew: interesting CS question (and I hate CS)
08:10 PM aandrew: a room has 100 lights in it, numbered 1-100. There are 100 toggle switches, one for each light. There are 100 engineers, numbered 1-100. Each engineer goes in sequence, entering the room and flipping the switches, starting with his number and skipping his number of switches
08:11 PM aandrew: i.e. engineer #1 toggles 1,2,3..99,100, engineer 2 toggles 2,4,6...98,100, up to engineer 100 who only toggles switch #100
08:11 PM aandrew: after they're all done, how many lights are on, and why
09:05 PM rue_mohr: I think I have code that does something like that for prime numbers
09:07 PM Tom_L: aandrew, none
09:07 PM Tom_L: they blew a fuse in the whole process
09:08 PM Tom_L: so engineer above 50 would only toggle one switch
09:19 PM aandrew: Tom_L: lol
09:23 PM Tom_L: it would also depend on the state of the lights when they began
09:23 PM Tom_L: that wasn't given
09:24 PM Tom_L: if they began in the off state, engineer 1 would surely blow the fuse if not before light 100
09:24 PM Tom_L: so you really need to know the wattage of the bulbs and the size of the fuse
09:24 PM Tom_L: and type of fuse
09:24 PM Tom_L: so
09:25 PM Tom_L: it's really a trick question :)
09:25 PM Tom_L: the CS prof would just hate me i'm sure
09:37 PM aandrew: Tom_L: my apologies, they're all off at the start
09:37 PM aandrew: I'm not a CS person
09:38 PM aandrew: I just brute forced it: https://pastebin.com/qPQYirbu
09:38 PM rue_mohr: :)
09:38 PM rue_mohr: I'd brute force it too
09:38 PM rue_mohr: but the answer was interesting yes?
09:38 PM aandrew: it was
09:39 PM rue_mohr: all on or all off?
09:39 PM aandrew: nope but it does have a mathematical explanation
09:55 PM rue_mohr: I tired to do 4 in my head and they all ended up off
10:34 PM Tom_L: i assembled 100 bulbs and switches and had them take a turn :)
10:44 PM rue_mohr: ok, pondering
10:44 PM rue_mohr: if I use a memory buffer for the text content on the screen
10:44 PM rue_mohr: the low level functions I need for the screen are..
10:44 PM rue_mohr: -block transfer buffer to screen
10:44 PM rue_mohr: -set cursor position
10:44 PM rue_mohr: -load custom character
10:45 PM rue_mohr: I wonder how fast the z80 can push a whole screen of content
10:45 PM rue_mohr: maybe its time to see
10:46 PM aandrew: you should give it a nice DMA controller
10:46 PM rue_mohr: hah
10:46 PM aandrew: do the screen udpates that way
10:46 PM aandrew: in fact you could probably do it with a couple counter ICs and some glue logic
10:46 PM rue_mohr: the screen has a 1 or 2Mhz interface
10:46 PM rue_mohr: the z80 has the counters :)
10:46 PM rue_mohr: rfsh
10:47 PM rue_mohr: I dont if z80 dma would hold the processor or run between cycles
10:48 PM rue_mohr: 8237 ?
10:49 PM rue_mohr: holdreq
10:49 PM rue_mohr: pfff nevermind
10:49 PM aandrew: there is something slightly perverted about using an intel DMA IC for a Z80
10:50 PM rue_mohr: heh, the poor 8088, the 8237 only did 16 bit addresses
10:50 PM rue_mohr: I'm kinda noticing intel io chips kinda suck
10:51 PM rue_mohr: "just write to this 8 bit port 3 times the load the 24 bit value"
10:51 PM rue_mohr: WTF.
10:51 PM rue_mohr: "the bits in this register mean this, unless that bit was set, in which case they mean that"
10:52 PM rue_mohr: the 8279 is a joke
10:52 PM rue_mohr: the screen and keyboard controller
10:52 PM rue_mohr: you can manually scan a keyboard and screen easier than using that chip
10:52 PM rue_mohr: I cringe when I see them on baords
10:53 PM rue_mohr: in context this lcd being split into two halves is nothing
10:54 PM aandrew: well to be fair I think they were built to work on both 8 and 16 bit busses
10:55 PM rue_mohr: I'm pretty sure I just saw the datasheet saying to use a 8212 for latching the addresses too
10:55 PM rue_mohr: !???!?! NO.
11:00 PM rue_mohr: going thru the code, changing things like CP #0x00 to OR A (sets flags)
11:08 PM rue_mohr: so, the whole IX IY thing allows you do handle values without touching the registers
11:09 PM rue_mohr: its getting addictive
11:09 PM rue_mohr: so I have a delay function
11:09 PM rue_mohr: you load BC with the size of the delay you want, and call the delay fn,
11:09 PM rue_mohr: it does nothing loops and comes back
11:09 PM rue_mohr: uses B and C registers
11:10 PM rue_mohr: however, if I want to redefine it as 256*n, I can use IY to push a static value directly into memory, and have the delay fn modify that, using no registers
11:10 PM rue_mohr: so you would
11:11 PM rue_mohr: ld DelayTime_OFF(IY),#55
11:11 PM rue_mohr: call longDelay
11:11 PM rue_mohr: you dont have to do ANY register dancing
11:11 PM rue_mohr: you get a delay 55*256 long
11:12 PM rue_mohr: you cant nest delays, so the fact its not a stack doesn't matter
11:17 PM rue_mohr: I suppose, the screen being split
11:17 PM rue_mohr: I can alternate top and bottom writes to get around busy times
11:18 PM rue_mohr: they are seperate chips
11:30 PM rue_mohr: what would be really awesome for this thing is a POWER SWITCH