Controling brightness on BBC micro computer

Forum for discussion of electronic television. Generally, stuff to do with CRTs and not using mechanical displays.

Controling brightness on BBC micro computer

Postby Viewmaster » Tue Aug 23, 2016 12:22 am

I'm toying with an ideas again. :)

The red/green/blue output from the old BBC micro computer
to the monitor is not analogue so the brightness cannot be controlled.

I was wondering if anyone has ever put 3 transistors, one in each colour,
in order to control the brightness ?

Using faster assembly language one might then have a machine which could run
variable number of lines for NBTV.

I was thinking of that LEGO camera that was mentioned by Harry, and using the Beeb
as the display for demos.
“One small step for a man,"......because he has Arthritis.
Albert.
User avatar
Viewmaster
Frankenstein was my uncle.
 
Posts: 1286
Joined: Fri Apr 06, 2007 4:50 am
Location: UK Midlands

Re: Controling brightness on BBC micro computer

Postby dominicbeesley » Tue Oct 11, 2016 5:36 am

That may be possible but it may well be easier to just use one of the other output ports (user port or printer port). I suspect you'd be struggling for speed though....I might have a go later as I've got a BBC on the desk next to me as we speak with its lid off...

It might be possible to trick the video ula and the 6845 chip into doing 32 lines but I think the slowest pixel clock is quite fast so it would want a lot of pixels on each line though there may be a way of tricking it to output the same pixel repeatedly

D
User avatar
dominicbeesley
Anyone have a spare straightjacket?
 
Posts: 683
Joined: Sat Sep 13, 2008 11:32 pm
Location: Hebden Bridge

Re: Controling brightness on BBC micro computer

Postby Viewmaster » Tue Oct 11, 2016 4:28 pm

dominicbeesley wrote:That may be possible but it may well be easier to just use one of the other output ports (user port or printer port). I suspect you'd be struggling for speed though....I might have a go later as I've got a BBC on the desk next to me as we speak with its lid off...

It might be possible to trick the video ula and the 6845 chip into doing 32 lines but I think the slowest pixel clock is quite fast so it would want a lot of pixels on each line though there may be a way of tricking it to output the same pixel repeatedly

D

Dominic, thanks for your ideas.

But now, I haven't bothered with the beeb as I am using a BBC BASIC emulator on my old laptop.

This is extremely fast ( I can scan and draw about 1,000 pixels per second on test).
Not only that but I now have 256x256x256 colours if need be!

One could use assembly language on the old beeb to speed things up but for me,
the emulator solves all.
“One small step for a man,"......because he has Arthritis.
Albert.
User avatar
Viewmaster
Frankenstein was my uncle.
 
Posts: 1286
Joined: Fri Apr 06, 2007 4:50 am
Location: UK Midlands

Re: Controling brightness on BBC micro computer

Postby dominicbeesley » Tue Oct 11, 2016 11:03 pm

Fair play, but you've whet my appetite so I've spent a while looking at the 6522 datasheets and think I might have a cunning plan...

D
User avatar
dominicbeesley
Anyone have a spare straightjacket?
 
Posts: 683
Joined: Sat Sep 13, 2008 11:32 pm
Location: Hebden Bridge

Re: Controling brightness on BBC micro computer

Postby Viewmaster » Tue Oct 11, 2016 11:41 pm

dominicbeesley wrote:Fair play, but you've whet my appetite so I've spent a while looking at the 6522 datasheets and think I might have a cunning plan...

D


Well, not sure if you have a particular project in mind but many others with beeb's
would be interested if you could cunningly get multi colours from the beeb.

But for the non purist who is not dedicated to the old beeb,
a PC emulator is the easiest way to go.
The one I use is BBC4BASIC and a simple VDU call gives all colours.

Good luck, Dominic, in your cunning enterprise. :)
“One small step for a man,"......because he has Arthritis.
Albert.
User avatar
Viewmaster
Frankenstein was my uncle.
 
Posts: 1286
Joined: Fri Apr 06, 2007 4:50 am
Location: UK Midlands

Re: Controling brightness on BBC micro computer

Postby dominicbeesley » Thu Oct 13, 2016 10:37 pm

Well, I had to give it a go, it took a bit of fiddling.

It hangs off the user port and uses Timer1 of the user VIA to generate a 20kHz square wave on PB7, this is fed to a transistor's base whose collector is connected back to the NMI line (available as a pin on the 1MHz bus). This generates a non-maskable interrupt 20,000 times a second and is the "pixel clock". An NMI routine then outputs the video data on the bottom PB0..3 lines of the user port and the sync signal on PB5.

The lines PB0-3 are fed to an inverting op-amp via suitable DAC resistors to give 16 greys and sync. As can be seen on the baby picture this isn't quite enough for detailed dark areas, however it would not be difficult to add a couple more pins and get 64 grey levels which is usually good enough.

The code is currently a BASIC/assembly language program that parks itself on the NMI vector at &0D00. After a bit of optimisation I got it running well enough that it only slows down the computer to half its original speed! My first attempt only left 16% of the original clock cycles over. The most complex bit is working out when to do a sync, with a bit of thought I could probably speed that up a little.

The scope traces shows the signal with a lot of spikes an overshoots - I don't think that this is me but the LM324N opamp tends to get giddy when fed with fast transients. I can't remember how I tamed it last time, I seem to remember it not liking working into too high an impedance load...

Once the code is running the computer is free to do other tasks and happily sits there outputting NBTV in the background. If there is interest I could improve this quite a bit.

- make a 1MHz bus version, leaving user port free (for MMC interface)
- make a ROM that can output NBTV in the background,
- colour?
- faster code

D
Attachments
s-DSC_0966.JPG
s-DSC_0966.JPG (132.6 KiB) Viewed 6081 times
s-DSC_0967.JPG
s-DSC_0967.JPG (109.72 KiB) Viewed 6081 times
s-DSC_0968.JPG
s-DSC_0968.JPG (110.67 KiB) Viewed 6081 times
s-DSC_0969.JPG
s-DSC_0969.JPG (100.12 KiB) Viewed 6081 times
s-DSC_0970.JPG
s-DSC_0970.JPG (124.2 KiB) Viewed 6081 times
s-DSC_0971.JPG
s-DSC_0971.JPG (284.51 KiB) Viewed 6081 times
User avatar
dominicbeesley
Anyone have a spare straightjacket?
 
Posts: 683
Joined: Sat Sep 13, 2008 11:32 pm
Location: Hebden Bridge

Re: Controling brightness on BBC micro computer

Postby Viewmaster » Thu Oct 13, 2016 11:08 pm

Dominic, I am very impressed on your beeb knowledge and to be able to do what you have done.
Bringing the old beeb into NBTV land.

I bet many would be interested in a NBTV newsletter article on what you have achieved.

If you go any further with this perhaps you can let us all know,
possibly under a new 'NBTV BBC micro' thread.

I forecast the sale of second hand beebs going up soon. :D
“One small step for a man,"......because he has Arthritis.
Albert.
User avatar
Viewmaster
Frankenstein was my uncle.
 
Posts: 1286
Joined: Fri Apr 06, 2007 4:50 am
Location: UK Midlands

Re: Controling brightness on BBC micro computer

Postby M3DVQ » Fri Oct 14, 2016 9:59 am

Oh my! That's amazing.
Now I'm pondering if I could do the same thing on a ZX Spectrum. Would just need a patched ROM to jump to a particular location on the NMI...
M3DVQ
Just nod and pretend you understand me
 
Posts: 326
Joined: Sat Feb 10, 2007 10:52 am
Location: Lincolnshire

Re: Controling brightness on BBC micro computer

Postby M3DVQ » Fri Oct 14, 2016 10:00 am

Viewmaster wrote:I forecast the sale of second hand beebs going up soon. :D


I have three under the bed :)
M3DVQ
Just nod and pretend you understand me
 
Posts: 326
Joined: Sat Feb 10, 2007 10:52 am
Location: Lincolnshire

Re: Controling brightness on BBC micro computer

Postby dominicbeesley » Fri Oct 14, 2016 7:51 pm

Its certainly possible on a z80, I did it, with colour, a few years ago on my CP/M machine - http://z80homebrew.blogspot.co.uk/2009/ ... olour.html

On a Spectrum it might be difficult to keep the normal screen output going at the same time as I think the screen uses the NMI...or is that the ZX81?

D
User avatar
dominicbeesley
Anyone have a spare straightjacket?
 
Posts: 683
Joined: Sat Sep 13, 2008 11:32 pm
Location: Hebden Bridge

Re: Controling brightness on BBC micro computer

Postby AncientBrit » Fri Oct 14, 2016 7:56 pm

Hi Dominic,

I second the comments.
Well done, an amazing bit of work.
I think it deserves a write up in the Newsletter,

Kind regards,

Graham
AncientBrit
Green padded cells are quite homely.
 
Posts: 858
Joined: Mon Mar 26, 2007 10:15 pm
Location: Billericay, UK

Re: Controling brightness on BBC micro computer

Postby M3DVQ » Sat Oct 15, 2016 12:37 am

dominicbeesley wrote:Its certainly possible on a z80, I did it, with colour, a few years ago on my CP/M machine - http://z80homebrew.blogspot.co.uk/2009/ ... olour.html

On a Spectrum it might be difficult to keep the normal screen output going at the same time as I think the screen uses the NMI...or is that the ZX81?

D


It's the ZX80 and ZX81 that use the CPU to generate the display. The Spectrum ULA reads directly from RAM. The CPU gets halted if it is also trying to access that contended RAM but that's not a problem as the NBTV driver can just run in the other 32KB.
The awkward bit will be deriving a suitable clock to drive the interrupt. Can't just use the 3.5MHz CPU clock on the I/O port divided down because of the aforementioned memory contention.
M3DVQ
Just nod and pretend you understand me
 
Posts: 326
Joined: Sat Feb 10, 2007 10:52 am
Location: Lincolnshire

Re: Controling brightness on BBC micro computer

Postby dominicbeesley » Tue Oct 18, 2016 10:56 pm

Thanks lads, I may well write it up for the newsletter but the televisor is destined for storage later this week as we are trying (slowly) to move house.

On the spectrum thing it should be possible then, a bit of jitter shouldn't matter so long as the NMI vector is free and uncontended. On the beeb there is a bit of jitter (due to differing instruction lengths and other factors) but the televisor doesn't seem to mind!

D
User avatar
dominicbeesley
Anyone have a spare straightjacket?
 
Posts: 683
Joined: Sat Sep 13, 2008 11:32 pm
Location: Hebden Bridge


Return to Electronic NBTV

Who is online

Users browsing this forum: No registered users and 1 guest

cron