6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun May 05, 2024 4:20 pm

All times are UTC




Post new topic Reply to topic  [ 88 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6
Author Message
PostPosted: Sat Dec 05, 2015 5:52 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10797
Location: England
GARTHWILSON wrote:
The RPi has very little general-purpose I/O; and with the things it does have, you won't have any hope of every understanding every bit of all the software layers right down to the metal. Where will the next generation of engineers come from?

True about the limited I/O, but not true about the layers. The RPi can run a variety of operating systems, including various Linux distributions, but it can also be programmed at bare metal level, running ARM code written in assembly. There are several github projects laying out some staged experiments specifically to help people learn how to do this.
See for example https://github.com/dwelch67/raspberrypi
[edit: and also http://www.valvers.com/open-software/ra ... g-in-cpt1/
which is bare metal but using C.]

Indeed, there's a project now running, over on Stardot, to hook up a raspberry Pi as an ARM-powered second processor to an Acorn Beeb, which is of course a 6502 machine:
http://stardot.org.uk/forums/viewtopic.php?f=3&t=10421
The minimal code needed on the Pi side will be written in assembly language to the bare metal. The interconnect to the 6502 host will be partly SPI based.


Last edited by BigEd on Sat Dec 05, 2015 8:11 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 05, 2015 7:39 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
Quote:
The RPi can run a variety of operating systems, including various Linux distributions, but it can also be programmed at bare metal level, running ARM code written in assembly.

Interesting. However, if someone were interested in running ARM code from the bare metal, I would recommend starting with a smaller ARM microcontroller instead. For instance, if you get an NXP LPC chip, you can download the free FlashMagic program, and use it to write a file to flash through a UART port. All you need on a Cortex is to put the initial stack pointer at address 0, and the reset vector at address 4, pointing to your bare metal code. Hit reset, and your program starts, running off the internal oscillator (which is accurate enough to run the UART).


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 05, 2015 7:41 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10797
Location: England
The single greatest advantage of the Pi is that it boots from SD card. So you can have one card to boot a linux, another to boot RiscOS, one for your minecraft or your scratch, and another for your bare metal work. There's no way that a mistake or misbehaviour in one environment can affect another - perfect isolation!

I do agree that an ARM microcontroller is also an interesting platform!


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 05, 2015 7:53 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
But I'm guessing the RPi offers a rather steep learning curve for the bare metal fans. I once made a bootloader for an TI OMAP SoC + companion chip, and the combined programming manuals were about 8000 pages, and the chip required many registers to set up correctly before you can get down to business. For someone coming out of the 6502 world, that can be a daunting task. At least with a simple microcontroller, the internal memories are all ready to go when you hit reset, and setting up an I/O port or a UART may require setting up just a handful or registers.


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 05, 2015 7:55 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10797
Location: England
Well, from what I recall of the github examples, I believe it's not too bad. Of course for many purposes you can copy and paste instead of reading enormous manuals.


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 05, 2015 8:02 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
Quote:
Of course for many purposes you can copy and paste instead of reading enormous manuals.

That's what I did. :lol: And then I only looked at a few relevant parts for my work. However, if your aim is to truly understand everything from the ground up, you shouldn't copy somebody else's code. Using it as an example is very helpful though.

There's also a danger with only consulting the parts of the manual that you think are relevant. The other day I was struggling for hours trying to get a peripheral to work, only to discover that it wasn't getting any clock, despite me setting the clock enable bit. Turns out that the module that had the clock enable bit wasn't powered, and required its own power enable bit, which was of course documented in a completely different part of the manual.


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 04, 2018 8:16 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8432
Location: Southern California
jmp(FFFA) wrote:
more technologically advanced in many ways than competitors like MacOS or Linux. But I didn't come here to be an apologist for Microsoft -- they don't need one anyway.

If Microsoft made an airliner, I wouldn't hesitate to fly in it. Safety and reliability are good business practices.

Elsewhere, BDD writes,
Quote:
The U.S. Navy tried that in the latter 1990s. There was a story about a warship at sea whose propulsion system was under the control of a Windows NT server. NT crashed and the engines came to a stop. The crew couldn't get the engines restarted and the ship had to be towed back to port.

A couple of weeks ago, I went into the local CVS to get some pictures printed. The kiosk and printers were run on Windows, and it all crashed while I was trying to order my pictures. It reminded me again of why I've been glad this household got off of Windows years ago.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 05, 2018 2:05 am 
Offline

Joined: Tue Nov 10, 2015 5:46 am
Posts: 215
Location: Kent, UK
GARTHWILSON wrote:
A couple of weeks ago, I went into the local CVS to get some pictures printed. The kiosk and printers were run on Windows, and it all crashed while I was trying to order my pictures. It reminded me again of why I've been glad this household got off of Windows years ago.
Meh, it's typically crappy 3rd party drivers that are crashy, not the kernel proper. But if hating on Microsoft empowers you, then attaboy I guess.


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 05, 2018 2:27 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8432
Location: Southern California
The blue screen had a message saying "Windows has crashed" or something like that.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 05, 2018 9:53 pm 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
As Garth has revealed this (interesting) thread I like to throw in my 2 cents :)
sark02 wrote:
Every chip is interesting, and I hope I don't come across as rude for challenging, but if you've chosen the '816 over ARM or MIPS, I'm curious as to why. What makes the '816 desirable, interesting or even essential in your projects? Is it instruction set familiarity, compatibility with your existing libraries of work, hardware features such as 5V tolerance or bus architecture, other? I'm genuinely interested to hear your stories.

First of all, the '816 is the only publicly available "official" successor of the 6502. There may other variants of this CPU being embedded somewhere, I don't know. Being an old fellow of the 6502 I cannot but take a look at that beast :) . To be honest - when I read the Byte article (198?) about the '816 I found it disgusting - yes! Being strongly influenced by CPUs like 68000 and Z8000 (only books) this '816 thing was no match. OK, the backwards compatibility could be nice - but who wants to run old 8 bit stuff anymore? Then these mode flags!! Oh no! After all this trouble with the D-flag now more of that?
But then:
Dr Jefyll wrote:
sark02 wrote:
if you've chosen the '816 over ARM or MIPS, I'm curious as to why.
sark02 wrote:
It's the 16-bit version that I'm curious about, and I do wonder what the attraction is.
Hm, did the question shift? Hope I'm not OT if I make a remark contrasting the 6502 with the 65816.

For me there was a big light bulb that went on when I realized that a TSC instruction followed by a TCD puts your Direct Page on stack. Suddenly Direct Page ceases to be a crowded place! And you get some amazing new address-mode flexibility -- for example being able to use a three-byte indirect pointer that's on-stack.

My admiration for the '816 designers went up several notches. The 256 super-flexible processor registers that Garth mentioned can be a stack frame! Despite certain downsides it's an idea which IMO gives '816 programming a whole new level of sophistication as compared to 6502/65C02.

And, speaking of 3-byte pointers: the "16-bit version" generates 24-bit addresses, so that's a huge step up from what the '02 and 'C02 can do!

-- Jeff

THIS nifty trick did raise my acceptance of the '816 significantly. This means a reasonable C compiler (or similar stack oriented languages) could produce acceptable results. And although here and there some 16 bit limits were present they can circumvented using long pointers and long addressing. As for fun building a sort of a home computer using a '816 (something like a "Mensch computer", just a little updated) seems to be a long range goal.

In the daily business there is no room for 65xx(x) stuff. Too expensive, outdated, difficult to use, poor tools,... Perhaps for educational purposes these basic components are of some use.


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 06, 2018 3:08 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3353
Location: Ontario, Canada
GaBuZoMeu wrote:
THIS nifty trick did raise my acceptance of the '816 significantly.
It *does* change the landscape considerably! :shock: I'm not the only one to think of it, though. I subsequently saw it mentioned elsewhere on 6502.org, and almost certainly it was in the designers' minds as well.

_________________
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: Mon Aug 06, 2018 5:11 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8432
Location: Southern California
GaBuZoMeu wrote:
First of all, the '816 is the only publicly available "official" successor of the 6502.

There was at least the 65CE02 in the late 80's which was in production only a short time. Interesting features included:

  • It eliminated most dead bus cycles. 31 instructions executed in a single cycle, breaking the 2-cycle minimum of previous 65xx processors.
  • Page-boundary crossings did not affect execution times.
  • 16-bit stack pointer with two modes of operation: full 16-bit pointer, and page-programmable 8-bit pointer.
  • Base register allows relocation of ZP.
  • three index registers: X, Y, and Z
  • more instructions and addressing modes, including word-relative conditional branches. The op-code table was full.

I have a couple of 65CE02's here.

Quote:
To be honest - when I read the Byte article (198?) about the '816 I found it disgusting - yes! Being strongly influenced by CPUs like 68000 and Z8000 (only books) this '816 thing was no match. OK, the backwards compatibility could be nice - but who wants to run old 8 bit stuff anymore? Then these mode flags!! Oh no! After all this trouble with the D-flag now more of that?

Magazine writers sometimes seemed unable to take the time to really get familiar with what they were writing about, and they tended to miss important capabilities, made other things difficult that didn't need to be, etc.. You mention the emulation-mode flag. It was important for an Apple IIGS which had to handle old Apple II software and also 16-bit IIGS software and possibly go back and forth quickly; but in my application, I have only put it in native mode in the reset routine and left it. I never touch it after that. My '816 Forth also leaves the accumulator in 16-bit mode and index registers in 8-bit mode almost full time, and I seldom changes them. Any 65xx blows the doors off a 68000 in interrupt performance though, and the '816 also outperformed the 68000 in the Sieve benchmark. [Edit, years later: I have an article, "The 65816 microprocessor: Common Misunderstandings, Plus Attractions," at http://wilsonminesco.com/816myths/ .]


Quote:
As for fun building a sort of a home computer using a '816 (something like a "Mensch computer", just a little updated) seems to be a long range goal.

In the daily business there is no room for 65xx(x) stuff. Too expensive, outdated, difficult to use, poor tools,... Perhaps for educational purposes these basic components are of some use.

There are companies that still consider it the best way to do some of their products, and the surprising volumes continue. Mike Naberezny just posted that he found out, from decapping an IC, that the instrument cluster in his Volkswagen Jetta was run by a 6502.

As for making a home computer with the '816, it's partly a matter of principle, about the user being able to completely understand and control his computer, unlike modern PCs. There is of course no expectation that it could replace modern PCs for doing things like photo editing on 36MP pictures while having 50 tabs open in a browser.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 06, 2018 8:02 pm 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
Dr Jefyll wrote:
GaBuZoMeu wrote:
THIS nifty trick did raise my acceptance of the '816 significantly.
It *does* change the landscape considerably! :shock: I'm not the only one to think of it, though. I subsequently saw it mentioned elsewhere on 6502.org, and almost certainly it was in the designers' minds as well.
I'm not sure whether this was truly the case. In the Byte article (Byte 1984, issue 8 (mostly architecture), and issue 9 (hardware)) they did not emphasis that. Perhaps I have overseen it, but this technique isn't mentioned in Eyes/Lichty "Programming the 65816" as well.

My assumption is based on the existence of the "Stack Relative Indirect Indexed" addressing mode. This is very similar to the "Direct Indirect Indexed". Would they have included the Stack Relative mode knowing that transferring SP to DPR would make the deal?

GARTHWILSON wrote:
There was at least the 65CE02 in the late 80's which was in production only a short time.
Correct! I was thinking of 16 bit successors only. The 65CE02 was a fine improvement, sadly that it wasn't distributed with more emphasis. (Otherwise I would have one for sure :) )

GARTHWILSON wrote:
Magazine writers sometimes seemed unable to take the time to really get familiar with what they were writing about, and they tended to miss important capabilities, made other things difficult that didn't need to be, etc..
Of course they should have/take the time but I know (or have learned) how difficult it is to judge the strength and weakness of a processor just by glimpsing at its instructions and register set. And of course it depends too on the application(s) you have in mind when looking at something new.


GARTHWILSON wrote:
Any 65xx blows the doors off a 68000 in interrupt performance though, and the '816 also outperformed the 68000 in the Sieve benchmark.
When driving a Rolls Royce you do not think about parking spots. :lol:

GARTHWILSON wrote:
There are companies that still consider it the best way to do some of their products, and the surprising volumes continue. Mike Naberezny just posted that he found out, from decapping an IC, that the instrument cluster in his Volkswagen Jetta was run by a 6502.
Sure, some products do exist. I bet the Jetta example is typical: pretty much thoroughly proofed and verified software - no one is allowed to change a single bit never! For one of our customers we have built weird workarounds in hardware as no one dares to touch the software! In that special case I remember only one (!) table value needs to be altered - and the overall CRC of course. But instead we built a hardware that alters the databus when this (and only this) fetch was taken :shock:


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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:  
cron