6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 15, 2024 12:12 pm

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Fri Aug 24, 2018 1:28 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
I've been using the DS1813 in some of my circuits for resetting the 65C02. Works great but they are a little pricey at around $2.43 each.

I'm also going to start learning the NXP SC28 UART which, IIRC, has an active-high reset (vs. active-low for 6502). Just use an inverter...no problem.

So instead of the DS1813 and an inverter, why not use an ATtiny13 for around $0.85? It has 6 I/O and can run 20 MHz (IIRC).

Could the ATtiny13 do the following?:

1) Monitor (and de-bounce) the reset button (1 I/O)
2) Hold 6502 reset high when button not pressed (1 I/O)
3) Hold NXP reset low when button not pressed (1 I/O)
4) Provide 1 MHz clock (1 I/O) for devices

That's 4 I/O lines.

Now, I'm not sure if it can really push a 1 MHz square wave externally. Of course, this limits has fast your machine can run but I'm building a 1 MHz machine anyway.

Even if I didn't use it for the clock, seems like a no-brainer for the reset lines.

Thoughts?


ATtiny13

https://www.mouser.com/ProductDetail/Mi ... NJHUXxU%3d

Datasheet

https://www.mouser.com/datasheet/2/268/ ... 315482.pdf

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 24, 2018 1:38 pm 
Offline

Joined: Sat Jan 02, 2016 10:22 am
Posts: 197
Another option for reset supervisor for less than the cost of the ATTiny13 is the TL7705.

It's got active high and active low resets. It's available in hobby friendly DIP packaging too.

I've used it with the 65C02 and 82C55 PPI.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 24, 2018 1:44 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
Ah, not a bad idea. Haven't seen those. They are a little cheaper.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 24, 2018 1:49 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
The internal oscillator runs a funny speed (4.8MHz or 9.6MHz) which might be awkward to scale down to 1MHz. I've never used Atmel chips directly.

I got a PIC16F18313 doing the same kind of thing a while back.
https://github.com/andrew-jacobs/hz-maker
The PIC has a 8MHz clock which can be divide down into 1, 2, 4 or 8Mhz output. It has a numerically controlled oscillator that is used to generate a 1.8432MHz signal for a 6551 ACIA but could produce other baud rate frequencies.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 24, 2018 1:54 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
I believe the Atmel chips can take an external clock up to 20MHz and then divide that down more evenly.

Ah, that's a good point about the ACIA clock too. For my UART, I think I need another clock of 3.6864 MHz. So perhaps I skip the ATtiny for clock generation, use a 3.6864 MHz crystal and just divide by 2 for the CPU clock. A little faster than 1 MHz but it would be in lock-step with the UART.

Not sure how important that is, however.

1 MHz makes the math easy. :-)

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 24, 2018 2:18 pm 
Offline
User avatar

Joined: Mon May 12, 2014 6:18 pm
Posts: 365
I have been thinking about something very similar. Those Atmel parts are very attractive since they work at up to 5v and cost around a dollar.

Looking at the datasheet, I did not find an option to reroute the system clock to one of the pins, so you would have to flip the clock pin yourself with code. With 9.6 MHz as the internal oscillator frequency, so you would have 9-10 cycles to flip the pin and jump back to the beginning of the flip routine. This might just be doable since the AVRs are supposed to have mostly single cycle instructions. I have never tried, though, so I'm not sure. If you want the 20 MHz frequency the datasheet mentions, you need to supply that signal to the chip yourself, since it doesn't have the circuitry to support a crystal.

I have been looking at another chip in that line called the ATtiny2313A, which is $1.36 and comes in DIP20:

http://ww1.microchip.com/downloads/en/D ... oc8246.pdf

On page 27 you can see that it has an 8 MHz internal oscillator that can be divided by 8, which gives you 1 MHz. Page 32 shows that you can output this signal on a pin, so you don't have to execute any code to generate the clock. It can run from an external clock like the ATtiny13 or from a crystal connected directly to the chip. This would let you generate any clock up to 20 MHz depending on the crystal you use if you want to build a faster 6502 system.

Another option with similar capability is the ATmega48 for $1.79 in DIP28:

https://www.mouser.com/datasheet/2/268/ ... 315337.pdf

You could replace a of functionality in the VIA and other chips since these have SPI/I2C/PWN/timers/ADC/USART built in.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 24, 2018 2:37 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
Martin A wrote:
Another option for reset supervisor for less than the cost of the ATTiny13 is the TL7705.

It's got active high and active low resets. It's available in hobby friendly DIP packaging too.

I've used it with the 65C02 and 82C55 PPI.


I also used the TL7705B in my recent C02 Pocket SBC. There are a small number of additional components, resistors/capacitors required but it's been a very good choice, as I also used a NXP UART, hence the positive going Reset signal requirement. Attached is a partial schematic showing the TL7705B Reset and a DS-1813 NMI Panic.
Attachment:
TL7705B_Circuit.jpg
TL7705B_Circuit.jpg [ 217.87 KiB | Viewed 4564 times ]

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 24, 2018 4:56 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8489
Location: Midwestern USA
cbmeeks wrote:
For my UART, I think I need another clock of 3.6864 MHz.

You do.

Quote:
So perhaps I skip the ATtiny for clock generation, use a 3.6864 MHz crystal and just divide by 2 for the CPU clock. A little faster than 1 MHz but it would be in lock-step with the UART.

Not sure how important that is, however.

NXP UARTs operate asynchronously to the MPU and only know about the 3.6864 MHz clock. Hence the MPU's Ø2 rate can be anything you want.

Incidentally, I recommend you use a can oscillator, not a crystal, to generate your clocks.

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


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 24, 2018 5:58 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
There's just something about using a micro controller made with ~50,000 transistors to run as a clock and reset circuit for a 3500 transistor CPU.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 24, 2018 6:24 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
BigDumbDinosaur wrote:
Incidentally, I recommend you use a can oscillator, not a crystal, to generate your clocks.


Yeah, that's actually what I meant. Just came out as crystal. :-)


whartung wrote:
There's just something about using a micro controller made with ~50,000 transistors to run as a clock and reset circuit for a 3500 transistor CPU.


Then there's that. lol.
That thought hasn't escaped me. However, I guess the same could be said about using any PLD's as well. Especially the larger ones.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 25, 2018 12:00 am 
Offline

Joined: Wed Feb 12, 2014 1:39 am
Posts: 173
Location: Sweden
That's not a bad idea, I wish I'd thought of it
My computer has an attiny861a working as the keyboard controller, with one spare pin. I could've just used it as my reset controller instead of the 1813


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 25, 2018 9:05 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
cbmeeks wrote:
Then there's that. lol.
That thought hasn't escaped me. However, I guess the same could be said about using any PLD's as well. Especially the larger ones.

Yea, it's just funny.

Just the state of the world today.

I was reading on another forum about a guy who made something that plugged in to his cars CAN bus.

On the car, if you reach in the door handle, its supposed to unlock automatically. Sometimes it takes a few tries.

He made something that would detect the door handle activity, and if it didn't see the "unlock door" request "quickly", it would send the door request again.

Now, I'm sure its more sophisticated than monitor the CAN traffic for a "2" and then sending a "3" after a timer, but it's not much more than that.

But the thing is he's using a Raspberry Pi Zero and a CAN bus controller. Basically ~$10 in hardware.

And now you have a machine with a GHz processor and hundreds of MBs of RAM....listening for a "2" so it can send a "3".

Just like Marvin the robot in Hitchhikers Guide.
Quote:
“Here I am, brain the size of a planet and they ask me to take you down to the bridge. Call that job satisfaction? ‘Cos I don’t.” –Marvin


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 27, 2018 6:54 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
LIV2 wrote:
My computer has an attiny861a working as the keyboard controller, with one spare pin. I could've just used it as my reset controller instead of the 1813


Yep, I have absolutely convinced myself to use some micro-controller for the reset logic. Then the question becomes...ATtiny for just resets or go all-out and put an Arduino compatible circuit onboard (minus the headers) so that I can get some easy SD/FAT libraries, easy EEPROM access, etc. :-D


whartung wrote:
I was reading on another forum about a guy who made something that plugged in to his cars CAN bus.

On the car, if you reach in the door handle, its supposed to unlock automatically. Sometimes it takes a few tries.

He made something that would detect the door handle activity, and if it didn't see the "unlock door" request "quickly", it would send the door request again.

Now, I'm sure its more sophisticated than monitor the CAN traffic for a "2" and then sending a "3" after a timer, but it's not much more than that.

But the thing is he's using a Raspberry Pi Zero and a CAN bus controller. Basically ~$10 in hardware.

And now you have a machine with a GHz processor and hundreds of MBs of RAM....listening for a "2" so it can send a "3".


I feel the same way. But like you said, that's where the "action" is these days. I've been blasted in other forums because I said I was tired of hearing about RPi projects. Now don't get me wrong, RPi is a great ecosystem, great device, etc. I'm just tired of hearing it over and over. lol.

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 29, 2018 7:05 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
whartung wrote:
I was reading on another forum about a guy who made something that plugged in to his cars CAN bus.

Bill, can you tell me please, what forum was that?

I PM'd you Monday with this question but for some reason the PM hasn't yet been read.

TIA,
Jeff

_________________
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: Thu Aug 30, 2018 11:21 am 
Offline

Joined: Tue Feb 24, 2015 11:07 pm
Posts: 81
cbmeeks wrote:
Now, I'm not sure if it can really push a 1 MHz square wave externally. Of course, this limits has fast your machine can run but I'm building a 1 MHz machine anyway.

It should be possible. I used C not assembler and used a software loop to manage PHI2 for simulating bus devices and got around 250 kHz from memory.

As others have said, many AVR devices other than the ATtiny13 can get a precise clock with only a crystal and a couple of capacitors such as in this board:

https://github.com/neilstockbridge/6502-computer/tree/master/R1

The ATtiny85 is another part also in DIP8 but with more program memory and peripherals and can use an external crystal (at the expense of losing two pins).

whartung wrote:
There's just something about using a micro controller made with ~50,000 transistors to run as a clock and reset circuit for a 3500 transistor CPU.

I started with AVRs in my 6502 system but then replaced them with FPGAs and finally period-correct logic in pursuit of purity. I think they're all different adventures though.


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 11 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: