UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio and TV Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > Specific Vintage Equipment > Vintage Computers

Notices

Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment.

Closed Thread
 
Thread Tools
Old 26th Apr 2023, 9:47 pm   #101
DavidMS
Pentode
 
Join Date: Nov 2022
Location: Chesham, Buckinghamshire, UK.
Posts: 135
Default Re: Anyone building a PICL? more PCBs available

Quote:
Originally Posted by Phil__G View Post
Ok that works nicely:

https://youtu.be/5NFXpMBwC0U

Theres a .zip on the PICL page of http://philg.uk under 'useful files'
Phil, after a bit of a work related delay got the PIC programmed and working this evening, I was slightly thrown by the lack of creature comforts in terms of menu options at reset, but looking at the PIC code could see this was a feature

I also did a bit of a test to see what would happen if you plug the PIC in the wrong way, and I am pleased to say it passed that test.

All in all a successful evening.
Attached Files
File Type: zip IMG_2448.zip (2.74 MB, 19 views)
DavidMS is offline  
Old 26th Apr 2023, 10:56 pm   #102
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,078
Default Re: Anyone building a PICL? more PCBs available

Hi David, yes thats exactly how NIBL greeted you in 1976, a simple >

I've done the same reversal trick a few times, pics are remarkably tolerant!

Thanks for prompting this by the way, its a worthwhile change to the 877 version, and also you'll find 'Life' a lot more bearable at 9600 rather than 1200
Just remember ALT/B to break in NIBL!

These are really handy for experiments like this, resistors built-in, cheap as chips
Cheers
Phil

Last edited by Phil__G; 26th Apr 2023 at 11:02 pm.
Phil__G is online now  
Old 27th Apr 2023, 7:00 am   #103
DavidMS
Pentode
 
Join Date: Nov 2022
Location: Chesham, Buckinghamshire, UK.
Posts: 135
Default Re: Anyone building a PICL? more PCBs available

Quote:
Originally Posted by Phil__G View Post
Hi David, yes thats exactly how NIBL greeted you in 1976, a simple >

Phil
In 1976, I wrote my first computer program (in BASIC) on punch cards - our maths teacher took them up to London to be batch run on a computer at I think Imperial, returning with print outs a couple of days later. I'm guessing it was about 1978 when we got a teletype acoustic connection to Hatfield Poly, closely followed by two RML Z80 machines. Happy days
DavidMS is offline  
Old 3rd May 2023, 7:07 pm   #104
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,078
Default Re: Anyone building a PICL? more PCBs available

CSA problem reading Sense A and Sense B buttons with the PIC16F18877 version of the PICL:

I had a look at Mikes code and found the CSA problem that affected the PIC16F18877 version
and the SA/SB button test program works fine with this. Below is a link to a hex file
that can be used with a Pickit3 and MPLAB IPE, this is how I did my own 18877 but I'm struggling
to get my head around Mikes Arduino loader... I wrote a quicky basic program that converts
Intel Hex to the weird 'reversed' PIC array format, that works fine but I'm still not sure about
patching the different sections in, bear with me or wait for Mikes return, he's been ill
and I'm sure you'll all join me in wishing Mike a speedy recovery!
Heres the new hexfile but treat this as an 'interim' until Mike approves, ta
(right-click, save, keep)(I dont have an ssl cert)

I know its a faff but it would be great if someone could give it a try please

Heres the NIBL test prog:
Code:
10 P=STAT
20 IF P AND 16 < 16 PRINT"YOU ARE PRESSING SENSE A"
30 IF P AND 32 < 32 PRINT"YOU ARE PRESSING SENSE B"
40 GOTO 10

Last edited by Phil__G; 3rd May 2023 at 7:33 pm.
Phil__G is online now  
Old 3rd May 2023, 11:41 pm   #105
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,078
Default Re: Anyone building a PICL? more PCBs available

I think I've done the Arduino programmer sketch, I've added it to the zip linked above, but its untested. Thats to say that as a programmer its unchanged, it should work as before, but the data it programs into the PIC is changed to todays code. Hopefully.
Here's the zip (right-click, save, keep)(I dont have an ssl cert)


.
Attached Thumbnails
Click image for larger version

Name:	mike_prog.jpg
Views:	29
Size:	134.6 KB
ID:	277687  

Last edited by Phil__G; 3rd May 2023 at 11:52 pm.
Phil__G is online now  
Old 4th May 2023, 12:45 am   #106
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,078
Default Re: Anyone building a PICL? more PCBs available

If its not clear, there are no external power supply connections to Mikes programmer, the whole thing is powered by the USB connection from your PC.
Just make the 5 wired connections, and join socket pins 11 to 21 and 12 to 31, Easy peasy.
Serial port is 9600 baud (8/N/1) with local echo on terminal. Commands are:
Blank test
Erase chip
ID
Dump ssss eeee
Program the 16F18877

Last edited by Phil__G; 4th May 2023 at 12:54 am.
Phil__G is online now  
Old 4th May 2023, 9:39 am   #107
DavidMS
Pentode
 
Join Date: Nov 2022
Location: Chesham, Buckinghamshire, UK.
Posts: 135
Default Re: Anyone building a PICL? more PCBs available

Will try to give it a try over the weekend, have been fighting to get MS visual studio to talk to a Pi Pico probe for last couple of days so could do with a rest playing PICs
DavidMS is offline  
Old 4th May 2023, 1:03 pm   #108
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,078
Default Re: Anyone building a PICL? more PCBs available

I've not done any Pi stuff at all, I think its probably beyond me
The new code works when the 18877 is programmed by Pickit, but when programmed by Mikes Arduinos programmer with the new code inserted, it doesnt work, I've done something wrong but I need a break I'm going boz-eyed here
Phil__G is online now  
Old 4th May 2023, 9:06 pm   #109
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,078
Default Re: Anyone building a PICL? more PCBs available

Ok the Arduino programmer with the new code embedded is working fine now.
I've programmed a few pics using both the Pickit3 and the Arduino, no probs with either. BTW I said the programmer interface was 9600, its not, the PICL is 9600 but the programmer runs 115200 - my mistook. Mikes Arduino programmer is a really convenient way to program a PICL - all you need is a Nano, a DIP40 socket & 5 wires
Talk to the programmer via the Nano usb using either Teraterm or the Arduino serial monitor, either works equally well (115200/n/8/1 local echo)

The code pre-loaded into the programmer is another update, it has the working CSA instruction so the Sense A/B buttons work, and also the SIO instruction driving what was the console-activity LED and is now SOUT. Serial out can be taken from the pad marked 'IO' (the last header pin next to the crystal). The async ascii serial test shown in the previous SIO/SOUT demo video works fine.

I think Mike has a script to produce these files but I've had to do it by hand so its taken a while to suss out (I'm a bit slow)
I've added the Arduino programmer sketch (which has been preloaded with the PICL code) to the zip file. (right-click, save, keep)
Again this is all interim pending Mikes approval when he's feeling up to it - get well soon Mike!
Cheers
Phil

Last edited by Phil__G; 4th May 2023 at 9:19 pm.
Phil__G is online now  
Old 5th May 2023, 12:27 am   #110
ortek_service
Octode
 
ortek_service's Avatar
 
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 1,392
Default Re: Anyone building a PICL? more PCBs available

Sorry to hear Mike's been ill, and wishing him a speedy recovery.
But thanks, Phil, for looking into this further and fixing this in the meantime.
And as you requested, I gave the new version a try earlier today and I confirm the Sense A & B buttons now work OK as expected in NIBL (I didn't try KitBug+ again, that had still worked, but I believe the issue was with the emulation of a special SC/MP instruction that the NIBL code was using).

Rather than going to the hassle of trying to wire-up an Arduino & load code into that / connect-up a Pickit, I thought I'd just use the old faithful Dataman (4)48Pro+, I've got easy access to.
I'd recently used this OK to program some PIC16F877's with your NIBL V2 code after I found a UK eBay supplier selling these for rather-less than component distributors (Although I did discover they had been previously-programmed, as I found code in one and other's FLASH was all 0's, so had to erase these first).
I wasn't sure if the updated .hex for the PIC16F18877 you'd attached included the Configuration bits, so I first just tried overwriting the old-code FLASH with it in case only one byte had changed and bits only changed to 0 so didn't require erasing (as newer ones are still using FLASH rather than EEPROM for program memory, so can't erase a single byte when required and must erase in blocks). But I soon got a run lots of verify errors, so it seems updated code has probably changed size and bytes are all shuffled-up a bit.

So I then chose to erase (the whole-chip's memory / config, as no option to only erase FLASH etc - only an option to preserve Data EEPROM contents) before programming). But the Dataman Pro kept reporting blank-check errors, with it 'read-protected' as memory lock-bits were now reading back as 0 when they were originally 1 before erasure (that it should also clear these to 1's, as well as FLASH Prog-Memory bits).
After finding this happened on both PIC16F18877's you'd previously programmed OK and sent me, I concluded there must be an issue with the Dataman's PC software. And after updating this (from the bit-old 2017 version, to the last (2020) version before they dropped support for old non-Pro2 series models), I found this did now actually erase these properly, reading back with bits all 1 in the blank-check that always follows an erase.

I wasn't sure if there were any critical config-byte / bit settings, and even with the later software it seems the lock-bits previously set to 0 weren't cleared to 1 when loading that.
So I first re-loaded the whole project file inc. config bits, that I'd fortunately saved a copy of by reading the contents of these PIC16F18877 you'd sent me with the previous version. Then loaded the new updated .hex file to just update the FLASH Program memory and programmed the now erased correctly F18877's - which now do seem to work fully-OK - Although I've only tried reading 'STAT' in a loop in NIBL, to show the Sense A & B inputs are now read into NIBL's 'Status' OK
ortek_service is offline  
Old 5th May 2023, 12:47 am   #111
ortek_service
Octode
 
ortek_service's Avatar
 
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 1,392
Default Re: Anyone building a PICL? more PCBs available

Quote:
Originally Posted by Phil__G View Post
CSA problem reading Sense A and Sense B buttons with the PIC16F18877 version of the PICL:
>>
>>

I know its a faff but it would be great if someone could give it a try please

Heres the NIBL test prog:
Code:
10 P=STAT
20 IF P AND 16 < 16 PRINT"YOU ARE PRESSING SENSE A"
30 IF P AND 32 < 32 PRINT"YOU ARE PRESSING SENSE B"
40 GOTO 10
For speed of typing it in, I did just try what I'd previously been trying:
Code:
10 PRINT STAT
20 GOTO 10
And whilst that does work OK - with the printed number decreasing by 16 / 32 (or 48 if both buttons held down which the other test prog won't detect) - I did notice that when neither button is pressed, then both old and updated PICL16F18877 versions show '191'. Whereas your PIC16F877 NIBL V2 version shows '176'. So you do have to be careful to only look at bit and not whole byte values, if you want a NIBL program to work on both of these.
Not sure if there is a 'correct' value for the other bits in Status, when read in NIBL - Although the four bits used for the Flag outputs would presumably be expected to read the same as output setting, whereas the 191 - 176 = 15 = (xxxx1111 in binary), would indicate a difference in default output state / how these are read into Status.
ortek_service is offline  
Old 5th May 2023, 4:20 pm   #112
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,078
Default Re: Anyone building a PICL? more PCBs available

Hi thanks for that Owen, the hexfile should be complete, config etc, I dont set lock bits or protect,
but I use a Pickit3 which may work differently to your Dataman, I dont know.
Yesterday I programmed quite a few, some brand new out of the packet, some re-used, some with the Arduino, some with the Picit3 and no problems with any of them.
Not sure how flag bits read on a genuine hardware SC/MP, I'd have to dig out the Andrew Aitken board to test it - but with things like the Sense A/B inputs, as a habit I always mask so I'm only reading the bits I need - thats on anything, not just the PICL status I'm pretty sure thats how most published code handles it too.
Code:
.
..
...

	CSA			; CHECK FOR SENSE A
	ANI	16
	JNZ	START
	JS	P3,0X2C00	; RETURN TO KITBUGPLUS IF SENSE A
...
..
.
Thanks for giving it a whirl Owen, seems we're on the right track
Cheers
Phil
Phil__G is online now  
Old 7th May 2023, 6:24 pm   #113
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,078
Default Re: Anyone building a PICL? more PCBs available

Quote:
Originally Posted by ortek_service View Post
(or 48 if both buttons held down which the other test prog won't detect)
The one listed? it does! It tests each individual bit, so if both buttons are pressed it reports both

Last edited by Phil__G; 7th May 2023 at 6:34 pm.
Phil__G is online now  
Old 10th May 2023, 12:33 am   #114
ortek_service
Octode
 
ortek_service's Avatar
 
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 1,392
Default Re: Anyone building a PICL? more PCBs available

Quote:
Originally Posted by Phil__G View Post
Quote:
Originally Posted by ortek_service View Post
(or 48 if both buttons held down which the other test prog won't detect)
The one listed? it does! It tests each individual bit, so if both buttons are pressed it reports both
Yes, it will still work if both are pressed at the same time, as it looks at status of each bit separately - rather than looking for particular byte values.
- What I'd meant to say was that it wouldn't report that both are pressed together, on a single line, so you'd get (scrolling) pairs of alternate separate lines for each button being pressed.
Although giving a single line 'result' for the 3 different press combinations would probably be a bit messy involving If's and GOTO's in many versions of BASIC, that lack 'Case' conditional - which I presume NIBL also doesn't have, unlike C-language's (appropriate) 'switch' statement.
ortek_service is offline  
Old 10th May 2023, 1:04 am   #115
ortek_service
Octode
 
ortek_service's Avatar
 
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 1,392
Default Re: Anyone building a PICL? more PCBs available

Quote:
Originally Posted by Phil__G View Post
Hi thanks for that Owen, the hexfile should be complete, config etc, I dont set lock bits or protect,
but I use a Pickit3 which may work differently to your Dataman, I dont know.
Yesterday I programmed quite a few, some brand new out of the packet, some re-used, some with the Arduino, some with the Picit3 and no problems with any of them.
Not sure how flag bits read on a genuine hardware SC/MP, I'd have to dig out the Andrew Aitken board to test it - but with things like the Sense A/B inputs, as a habit I always mask so I'm only reading the bits I need - thats on anything, not just the PICL status I'm pretty sure thats how most published code handles it too.
Code:
.
..
...

	CSA			; CHECK FOR SENSE A
	ANI	16
	JNZ	START
	JS	P3,0X2C00	; RETURN TO KITBUGPLUS IF SENSE A
...
..
.
Thanks for giving it a whirl Owen, seems we're on the right track
Cheers
Phil
I'd noticed that if the lock / protect bits were already cleared to 0, in the Dataman Programmer software (mainly due to bug in older versions, clearing these to 0, on erase), then loading the hex file didn't reset these to 1. So I presumed the full-config wasn't included in the hex file.
But maybe MPLAB only normally includes these in the output file if you explicitly specify them using directives in the source file - normally to change from defaults. And might also be able to specify the values all the Config / Lock bytes should be (even when they should normally be these in their default erased-state), in case the IC's config hasn't been correctly erased to default values.

I imagine that the output Flags lines seemingly read-back differently on the two version - so one version presumably being different to NIBL(E) - would only really be an issue if you didn't keep a local-copy of what the Flag bits were set to and wanted to check these by trying to read the Status.

Maybe someone on here has got NIBL(E) running close to hand, to save you having to find your genuine SC/MP one - I did ask Chris if he'd tried running NIBL-E on his updated MK14(E), but he hasn't yet tried using it with the memory-expansion he's planned for it to support (He says he still needs to finalise the address-decoding, using minimal extra gates logic, to produce a final 'V3' design from his current 'V2' PCB that is now working OK as a standard MK14).

It would be interesting if you're ale to share the source code / what you changed on Mike's PIC16F18877 version to fix this Sense A / B that just affected NIBL - I only saw the source he'd posted (when he'd tried changing one byte to try to fix it) that was removed shortly afterwards so now can't look at that again, as I hadn't saved a copy on my own PC's.
ortek_service is offline  
Old 10th May 2023, 1:05 am   #116
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,078
Default Re: Anyone building a PICL? more PCBs available

if you wanted to test solely for A+B together in a NIBL prog, then
10 IF STAT AND 48=0 THEN PRINT "BOTH PRESSED"
Is that what you're looking for Owen? bear in mind the progs in the PICL doc are just simple examples to demo what NIBL can do...

Re the changes, I'm awaiting Mikes return, I think thats only fair, he will probably want to rework the changes
Briefly it was the way the CSA instruction was coded, plus making the SIO instruction output to SOUT (for David)

I forgot to try it before but my 18877 PICL here on my lap reports set flags correctly... if I say STAT=1 then PRINT STAT, then it shows bit 0 set, same for STAT=2,4,8 and any combination...

Last edited by Phil__G; 10th May 2023 at 1:22 am.
Phil__G is online now  
Old 10th May 2023, 1:43 am   #117
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,078
Default Re: Anyone building a PICL? more PCBs available

Code:
>LIST
10 STAT=1:PR STAT AND 1
20 FOR T=1 TO 200:NEXT T
30 STAT=2:PR STAT AND 2
40 FOR T=1 TO 200:NEXT T
50 STAT=4:PR STAT AND 4
60 FOR T=1 TO 200:NEXT T
70 STAT=8:PR STAT AND 8
80 FOR T=1 TO 200:NEXT T
90 STAT=15:PR STAT AND 15
95 STAT=0

>RUN
 1
 2
 4
 8
 15

>
Not sure about M/C, I'd have to write something to test it
Phil__G is online now  
Old 10th May 2023, 2:17 am   #118
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,078
Default Re: Anyone building a PICL? more PCBs available

Here you go Owen,
As expected, the flags are correctly reported by CSA in a M/C (see attached) or a NIBL program (see above)
Attached Files
File Type: zip flagtest.zip (2.0 KB, 14 views)

Last edited by Phil__G; 10th May 2023 at 2:29 am.
Phil__G is online now  
Old 10th May 2023, 2:59 am   #119
ortek_service
Octode
 
ortek_service's Avatar
 
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 1,392
Default Re: Anyone building a PICL? more PCBs available

Quote:
Originally Posted by Phil__G View Post
if you wanted to test solely for A+B together in a NIBL prog, then
10 IF STAT AND 48=0 THEN PRINT "BOTH PRESSED"
Is that what you're looking for Owen? bear in mind the progs in the PICL doc are just simple examples to demo what NIBL can do...

Re the changes, I'm awaiting Mikes return, I think thats only fair, he will probably want to rework the changes
Briefly it was the way the CSA instruction was coded, plus making the SIO instruction output to SOUT (for David)

I forgot to try it before but my 18877 PICL here on my lap reports set flags correctly... if I say STAT=1 then PRINT STAT, then it shows bit 0 set, same for STAT=2,4,8 and any combination...
Thanks, Phil, for that.
Yes, doing one case is quite easy to do. It's when you want to handle all the cases/combinations, with a single-line message, that things get a bit more involved - especially in a fairly 'basic' programming language, and might need to resort to the often dislike 'GOTO' jump.

Yes, happy to wait for Mike's return to see finalised version. I hadn't realised you'd also done the SIO changes to the 16F18877 version, as well as doing that on a (now 9600bps serial) 16F877 PIC version.

IIRC, the Flag-Output LED's were all off on both PIC16F877 & PIC16F18877 versions I tried, when I found there was a difference of '15' between read 'STAT' values. But maybe there is something in the emulation that doesn't quite get initialised the same between the different PIC versions until a write to STAT is done. I'll try and have a bit more of a play with the 2 versions in the next day or so.
ortek_service is offline  
Closed Thread

Thread Tools



All times are GMT +1. The time now is 11:45 am.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2002 - 2023, Paul Stenning.