6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 2:57 am

All times are UTC




Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Sun Oct 31, 2021 1:59 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
kalj wrote:
I believe I found an answer to my NMI/DS1813 question:
viewtopic.php?f=2&t=2871&start=0#p31909
Re debouncing, I've just made a followup post in that thread.

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 31, 2021 3:15 pm 
Offline

Joined: Sat Oct 23, 2021 8:05 am
Posts: 15
Location: Sweden
Thanks all for helping out. I just made the pcb order to JLCPCB. Can't wait for the stuff to arrive!


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 31, 2021 4:37 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
kalj wrote:
Okay, so sounds like something that is rarely used, but which could still come in handy.

What is the most space efficient way of doing the NMI debouncing? I'd prefer if I didn't have to fit an extra 74HC14. I guess I could try to duplicate the reset circuit with the ds1813, but maybe that gives strange effects on power on?

I use the DS1813 in the NMI "panic button" circuit. It has worked glitch-free in POC V1.0, V1.1, V1.2 and V1.3. At power-on, the panic circuit will start out in the asserted (low) state, but the microprocessor won't care, because NMIB is edge-sensitive, but only in the low-going direction. At power-on, the "edge" never happens because the DS1813's output is already low. The MPU won't respond to a high-going edge, which is why this very simple arrangement works without any problems.

In the firmware's NMI handler, a check is made to see if the interrupted code is in the firmware itself. If it is, the NMI handler immediately returns to the interrupted code without any apparent effect on the system.

Code:
;inmi: NON-MASKABLE INTERRUPT SERVICE ROUTINE
;
inmi     rep #m_setr           ;16-bit registers
         phb                   ;save machine state
         phd
         pha
         phx
         phy
         jmp (ivnmi)           ;NMI indirect vector
;
;   ———————————————————————————————————————————————————————————
;   NMI processing re-enters here if IVNMI hasn't been altered.
;   ———————————————————————————————————————————————————————————
;
inmia    sep #m_seta           ;8-bit registers
         lda nmi_pbx,S         ;anywhere in bank $00?
         bne .0000010          ;no, intercept the NMI
;
         rep #m_seta           ;yes
         lda nmi_pcx,S         ;interrupted address
         cmp !#mm_rom          ;anywhere in ROM?
         bcs crti              ;yes, ignore NMI
;
.0000010 jmp monbrk            ;enter monitor thru BRK portal

If the interrupted code is not in firmware space, the NMI handler jumps to the BRK entry point of the machine language monitor. It's a convenient arrangement for software testing and debugging.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 31, 2021 4:41 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
Proxy wrote:
i would personally go with USB, USB-B to be exact. i've been using it ever since my first SBC and it's been working very well.

I don't agree with that at all. Compared to any of the USB jacks and plugs, barrel plugs are nearly indestructible, and have lower insertion resistance. What's with this mania to get USB stuff involved with everything? As Garth said, there's nothing "universal" about a "standard" that uses so many connector types, all of them fragile to varying degrees.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 31, 2021 6:07 pm 
Offline

Joined: Mon Feb 15, 2021 2:11 am
Posts: 100
BigDumbDinosaur wrote:
Proxy wrote:
i would personally go with USB, USB-B to be exact. i've been using it ever since my first SBC and it's been working very well.

I don't agree with that at all. Compared to any of the USB jacks and plugs, barrel plugs are nearly indestructible, and have lower insertion resistance. What's with this mania to get USB stuff involved with everything? As Garth said, there's nothing "universal" about a "standard" that uses so many connector types, all of them fragile to varying degrees.


I'd prefer a barrel jack, myself, but if I had to use USB for power, USB-B is probably the best of the lot. I've had a few devices that used USB-B and it always felt the most snug/secure of the lot, and is of decent physical size.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 02, 2021 5:41 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
kalj wrote:
Oh, and one final question. Which would you go with for the power socket: DC barrel connector or USB B / USB mini? I can't make up my mind.


Screw terminals. Either the ones that use spade terminals or the ones that directly clamp bare wire. Best .. Connection .. Ever! I tend toward the direct wire clamp type as I can use any suitable wall wart then just hack the plug off the end, strip a little insulation of each wire and your in business.

_________________
Bill


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 02, 2021 5:58 pm 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1431
Screw terminals, three pins.

Center pin VCC, outer pins GND.
This reduces the chance of swapping VCC and GND by accident.


Top
 Profile  
Reply with quote  
PostPosted: Tue Nov 02, 2021 7:52 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
BigDumbDinosaur wrote:
What's with this mania to get USB stuff involved with everything?

No worries, mate. It's just the yin to your yang, and the equal but opposing forces make the universe better, or at least more interesting.

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 38 posts ]  Go to page Previous  1, 2, 3

All times are UTC


Who is online

Users browsing this forum: qookie and 50 guests


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 post attachments in this forum

Search for:
Jump to: