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 30th Mar 2023, 2:17 pm   #41
Michael - K8LH
Triode
 
Join Date: Dec 2021
Location: Michigan, USA
Posts: 40
Default Re: Anyone building a PICL? more PCBs available

The problem exists on my boards, too, so once I find the problem it should be easy to fix the issue in the program for the 'standard' boards. Patience, please.
Michael - K8LH is offline  
Old 31st Mar 2023, 1:43 am   #42
ortek_service
Octode
 
ortek_service's Avatar
 
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 1,394
Default Re: Anyone building a PICL? more PCBs available

Quote:
Originally Posted by Phil__G View Post
Inside the box there should have been a small instruction sheet Owen, maybe it fell out:

PICL using the PIC16F18877

Normal power on asks [W]arm [C]old or [K]itbug?

Power on with Sense-A auto-runs the machine-code
program whose address is at 2FFE/2FFF (lightshow, as supplied)

Power on with Sense-B asks [L]oad Intel hex or
[S]ave current program to flash?

After entering a new NIBL program, to save it hold
Sense-B whilst dabbing Reset, then type 'S'
To load this program, on power up, choose 'W'

NIBL is uppercase only. Set 9600, local echo = on,
line delay 200ms, character delay 2ms
Note different PIC build to suit clock speed:
20mhz xtal for 20mhz, SC/MP 4mhz equivalent


As you see, "W" for warm start loads the last saved program. If you didn't save it, the last saved program is empty. Hope this makes sense!

Re the sense buttons, I just tried the NIBL test program from the PICLV2 document, and you're right!
They work fine with the 877 firmware but apparently not with Mikes 18877 version, I hadnt noticed until now!
Code:
10 P=STAT
20 IF P AND 32 < 32 PRINT”YOU ARE PRESSING SENSE-B”
30 IF P AND 16 < 16 PRINT”YOU ARE PRESSING SENSE-A”
40 GOTO 10
Cheers
Phil
Thanks Phil, for this info - Fortunately I'd already seen it mentioned that the PIC16F18877 serial ran at 9600bps, as there didn't appear to be a paper note in with the PIC16F18877's you'd sent me. I didn't know about the extra features, activated by holding down SenseA / SenseB at reset - but I guess that might not work if not being read correctly?
- However, I've just tried holding down SenseA, and resetting, and this does work! (displaying the light-show).
Plus holding down SenseB, and resetting, gives Load HEX, Save to Flash choices.
So it seems the buttons are getting read OK at reset, at least (and maybe something else after that is conflicting with Status reading)


I had initially thought Warm Start might had been like an 'Old' command, that allowed you to get straight back to last running program (I haven't found how you can escape from one, without a reset - and then possibly losing unsaved prog, even when held in NV/F-RAM)
But Chris had also found that the original 16F877 PICL/NIBL seemed to over-write the first 2 bytes of the program (line no.), and could recover it, if re-entering those bytes.
- So maybe it would be possible to have a third 'Hot Start' option to do this, as glancing through 16F18877 source, it seems a change was previously-made to only erase a smaller area, after Cold Start.

I'd tried it at work, with Chris telling me what to type in NIBL to read / write Status Flags (when we first discovered buttons weren't being read!). And we just used this, for simplicity - Where I only got '191' (10111111 binary pattern) all the time:
10 PRINT STAT
20 GOTO 10

Chris thought the buttons were actually working with the PIC16F18877 I gave him, when he first tried them. But when I asked what STAT values he got, he said he now too only got STAT=191 on this.
However, with the 877A, he got 176 (10110000 binary pattern) with switches open, 160 (10100000) for A-only activated and 144 (10010000) for B-only activated.
So I wonder if this info with FLAG bits F0..F3 always reading low, rather than high, (along with SA & SB actually working at reset) might be of assistance in finding the issue with this 16F18877 version's code?

Last edited by ortek_service; 31st Mar 2023 at 1:51 am.
ortek_service is offline  
Old 31st Mar 2023, 2:56 am   #43
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,080
Default Re: Anyone building a PICL? more PCBs available

The buttons work at reset because thats PIC code Owen, all that stuff happens before entering the emulation. Once NIBL or the monitor is running, thats SC/MP code, its the scamp CSA instruction thats not emulating properly - or rather the port read during the CSA.
The button test program (a few posts up) works fine on the 877 or 877A.
If I know Mike, he won't sleep until its fixed!
Cheers
Phil
Phil__G is online now  
Old 1st Apr 2023, 2:14 am   #44
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,080
Default Re: Anyone building a PICL? more PCBs available

https://youtu.be/ilhwIp9jLEE
Phil__G is online now  
Old 1st Apr 2023, 10:51 am   #45
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,080
Default Re: Anyone building a PICL? more PCBs available

Whoops sorry the link to the SC/MP source code was broken, its fixed
Its on the PICL page of http://philg.uk under the header "Some useful files, docs & links:".
Phil__G is online now  
Old 1st Apr 2023, 12:29 pm   #46
Realtime
Hexode
 
Join Date: Jan 2021
Location: Ashford, Kent, UK
Posts: 318
Default Re: Anyone building a PICL? more PCBs available

Hi Phil, enjoyed the Life video I'm just looking at the assembler listing for Life and I'm a bit confused:

Code:
NXTBYT:	LD	@1(P1)
	JZ	DOT
	LDI	'#'
	JMP	HASH
DOT:	LDI	$2E		; MAKE IT PRINTABLE
HASH:	.DB	0X20		; PUTC
	LDI	0
	ST	@1(P2)		; CLEAR GEN2 ARRAY
	DLD	0(3)
	JNZ	NXTBYT
The accumulator is loaded with # or . depending on the content of (P1). It then executes an illegal op-code (0x20 at label HASH) commented as PUTC. How is that used to display a character in Kitbug? Does it trap 0x20?
Realtime is offline  
Old 1st Apr 2023, 2:46 pm   #47
ortek_service
Octode
 
ortek_service's Avatar
 
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 1,394
Default Re: Anyone building a PICL? more PCBs available

Quote:
Originally Posted by Phil__G View Post
The buttons work at reset because thats PIC code Owen, all that stuff happens before entering the emulation. Once NIBL or the monitor is running, thats SC/MP code, its the scamp CSA instruction thats not emulating properly - or rather the port read during the CSA.
>>
Phil
Yes, I'd realised that, but I'd thought this part working at least did illustrate that the PIC16F18877's I/O registers were being configured correctly to start with. And maybe (as it seems Mike used different PIC GPIO's on the first version he'd done for the F18877, and had apparently worked OK? - before later modifying it to be pin-compatible with the original F877) somewhere else (in SC/MP emulation code routines etc.) was still using an older mapping.

Plus that would presumably also affect Kitbug+
- I've just tried this for the first time, and found when using 'R' to display SC/MP registers, then ST always shows 'FF'. Whereas it was I presume holding down the buttons before doing that should affect bits in the Status register (especially as I see it was always 30h in screenshots in the PICLV2 PDF manual.


Once a new PIC16F18877 version with the bug-fixed is available, then I presume the mini Arduino module + sketch program Mike had attached to a (now removed?) zip file on previous possible fix post is only required for those who haven't got a programmer that supports the PIC16F18877 ?

I know you'd said programming these was a bit awkward, but when I'd readout one you'd done for me on a Dataman-Pro, it seemed all the Config options were at defaults and EEPROM was also all blank. Although the save IntelHex file from it, seem to have several regions, when I viewed it in HxD.

So I presume it should just be a case of re-programming the FLASH and could do this with MPLAB and a PICkit, using a suitable DIL40 breakout board (Like a PIC16F877 Demo one I have) ?
- Unless you've got access to a Universal programmer (It seems a TL866 also supports it).
ortek_service is offline  
Old 1st Apr 2023, 3:02 pm   #48
ortek_service
Octode
 
ortek_service's Avatar
 
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 1,394
Default Re: Anyone building a PICL? more PCBs available

Quote:
Originally Posted by Phil__G View Post
Quote:
Originally Posted by Phil__G View Post
Whoops sorry the link to the SC/MP source code was broken, its fixed
Its on the PICL page of http://philg.uk under the header "Some useful files, docs & links:".
I've now also got this "John Conway's Game of Life in SC/MP assembler for the PICLv2", running - As on attached screenshot.

It was the first time I'd tried uploading a program to this, and installed latest TeraTerm 4.106, as I didn't know about setting character / Line delays in other Terminal programs, trying 1ms & 100ms as I wondered if the 9600 version didn't need as long delays as 1200 baud's suggested 3ms & 300ms, that I'd tried but didn't realise how long you needed to wait before hex-load 'done' appeared.
- But I then later read you didn't need these delays for hex loader, only sending to NIBL, so it seems I'd got a bit confused over this when I didn't know what to expect when hex-loader completed.

I also eventually worked-out, looking at source code, that after PICL reset, I needed to go into Kitbug+ and type G1800, to run it as it had been uploaded to that RAM address.
- But I presume it's also possible to do a Cold / Warm restart into NIBL (if that only erases first 2-bytes / copies a 1-line program to start of Page 2?) and issue a call to the start address from that?
Attached Thumbnails
Click image for larger version

Name:	PICL_Life.JPG
Views:	25
Size:	30.2 KB
ID:	276184  

Last edited by ortek_service; 1st Apr 2023 at 3:09 pm.
ortek_service is offline  
Old 1st Apr 2023, 6:52 pm   #49
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,080
Default Re: Anyone building a PICL? more PCBs available

Quote:
Originally Posted by Realtime View Post
It then executes an illegal op-code (0x20 at label HASH) commented as PUTC. How is that used to display a character in Kitbug? Does it trap 0x20?
Hi Ian
When implementing NIBL on the PICL Karen made a few small changes, the standard I/O routines GECO and PUTC are actually run in PIC code rather than emulated SC/MP code, so Karen gave each an opcode to make the calls easy. I also use these in KB+
0x20 = putc
0x21 = geco (but actually doesnt echo)
0x22 = check for a character (I think its called 'break' in NS speak. cant remember without looking it up)

Code:
For putc, 0x20 replaces:
C4 C4   LDI 0C4H ; PUTC is at 01C5
33      XPAL (3)
C4 01   LDI 01
37      XPAH (3)
3F      XPPC (3)

...and for GECO, 0x21 replaces:
C4 85   LDI 85H ; GECO is at 0186
33      XPAL (3)
C4 01   LDI 01
37      XPAH (3)
3F      XPPC (3)
Owen, the register images for the R command are set on loading KB+,
to test the result of a program etc you'd terminate your sc/mp program (or set a breakpoint) with XPPX P3 (0x3F) and the R would show the register contenst returned by that program. In other words R shows a RAM copy if the registers, you can set the register contents manually before running a program (same idea as for the MK14) by editing the register image in memory, these are picked up on a 'G' command.

Re programming, just for the challenge I forced myself through the mplab process and it was painful, unloading the current one, finding & loading an obsolete version etc, I wouldnt avoidably do it again, its so much easier to use Mikes Arduino method! Uses any old Nano which can be re-purposed later.
But yes, its all in flash, you can see NIBL, KitbugPlus and the Lightshow if you do a hexdump of the PIC flash.

Cheers
Phil
PS thats right, the character delays aren't necessary for the hexloader, only for NIBL, life.hex loads quite quickly without them
PPS the life.asm code is quite verbose as I've not tried optimizing anything other than clearing gen2 simultaneously with printing gen1. I'm sure it could be much improved! For one thing you could remove the .DS 576 from gen2: its only there to reserve memory. That would almost halve the hexfile size!

Last edited by Phil__G; 1st Apr 2023 at 7:04 pm.
Phil__G is online now  
Old 2nd Apr 2023, 12:33 am   #50
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,080
Default Re: Anyone building a PICL? more PCBs available

Heres a demo of the register command Owen.
Did you download the PICLv2 manual ok, it details KitbugPlus
Cheers
Phil
Attached Files
File Type: zip registers.zip (1.5 KB, 17 views)
Phil__G is online now  
Old 2nd Apr 2023, 10:57 am   #51
ortek_service
Octode
 
ortek_service's Avatar
 
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 1,394
Default Re: Anyone building a PICL? more PCBs available

Thanks for the info, Phil.

I did have an older version 5.x of MPLAB-X installed, that I'd read was below the number that was said not to work anymore with this - Although I thought that was just an issue for the assembler, and it would still be possible to load a .hex file and use MPLAB just for programming.

However, as I have access to a Dataman-Pro with a ZIF DIL48 socket, that seems to read one OK at least (And Chris's TL866-II may also support the F18877, as well as the 877A he used it for). So I'll probably just try, to save having to do any wiring-up etc.

Yes, the PICv2 manual was the first one I'd downloaded in order to assemble the board. And then discovered the Kitbug+ info in there, whilst looking for instructions for that, as would have been rather lost without the info in there.
I'll give that Registers demo a try, a bit later, to see if it gives different ST values - Although I would expect ST probably should have been 30h, rather than FF, as shown on your F877 + KitBug+ loaded examples in that pdf.
ortek_service is offline  
Old 2nd Apr 2023, 11:20 am   #52
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,080
Default Re: Anyone building a PICL? more PCBs available

The key thing is that the memory area just below $2C00 displayed by the 'R' command isnt populated from the real hardware registers until your code executes a breakpoint 3F. Then, the R command is used to display that bit of memory. Before running a program with 'G' (goto) you can pre-set the hardware registers by editing values into this memory, but when KitbugPlus is first loaded, the values below $2C00 which 'G' copies to the hardware registers are arbitrary. It works very much like SCIOS in the MK14

I know my docs aren't the best, often rushed and key points may be skipped, a more accurate description for the KB+ document would be "that 'R' doesnt actually display the hardware registers in real time, it displays part of memory reserved for storing the register contents following a breakpoint, and prior to a breakpoint, unless manually edited, this area of memory isnt initialised. Any manually edited or arbitrary values at these addresses are copied to the hardware registers on a 'G' command."

SR is at $2BFF
EX is at $2BFE
AC is at $2BFD
PT2 is at $2BFB & 2BFC
PT1 is at $2BF9 & 2BFA
PC is at $2BF7 & 2BF8

(P3 holds the PC address you just came from with the XPPC P3)

Cheers
Phil

Last edited by Phil__G; 2nd Apr 2023 at 11:41 am.
Phil__G is online now  
Old 2nd Apr 2023, 8:49 pm   #53
ortek_service
Octode
 
ortek_service's Avatar
 
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 1,394
Default Re: Anyone building a PICL? more PCBs available

Thanks for extra info about this.
I've just loaded your 'Registers.hex' demo.
And ran it in KitBug+, using 'G2200', finding that it sets Status to xAh (xxxx1010)
- So F3=High, F2=Low, F1=High, F0=Low (With F3 & F1 LED's lit to show this).
Pressing 'R' after this, then shows 'ST' is now '3A'.

More surprisingly, I also discovered that if I hold down SA / SB switches, before issuing a 'G2200' then type 'R', I get:
SB SA ST
H H 3A (Neither Switch Pushed, so SA & SB still High via pull-ups)
H L 2A
L H 1A
L L 0A (Both Switches pushes, grounding SA & SB)


So the switches (/ SenseA & SenseB) are getting read OK on F18877 version, by KitBug+
- Which I thought was also written in SC/MP assembler.
And so is using the same PIC Emulation code as for NIBL?
(In which case, has NIBL itself been changed / NIBL uses different SC/MP instructions, that aren't quite working properly - So could also prevent other SC/MP programs from running correctly, that used these, and not just problems reading the Status reg.)

Last edited by ortek_service; 2nd Apr 2023 at 8:55 pm.
ortek_service is offline  
Old 2nd Apr 2023, 9:22 pm   #54
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,080
Default Re: Anyone building a PICL? more PCBs available

Ah I'm with you now Owen!!! sorry a bit slow on the uptake here...
Yes it does seem the sense inputs are being merged into the status as you'd expect
Hmmm... more to this than first apparent....
Phil__G is online now  
Old 2nd Apr 2023, 9:39 pm   #55
ortek_service
Octode
 
ortek_service's Avatar
 
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 1,394
Default Re: Anyone building a PICL? more PCBs available

One thing that did surprise me, was if I reset it, and again selected [K]itbug+, plus typed 'G2200', I then got it going into continuous-loop LED lightshow.

- So I presume that routine must be getting re-copied from PIC-FLASH, into the (F)RAM, at the same 2200h address (even without holding down Sense A switch at reset).
But when it automatically-resets (displaying the same C / W / K choices menu), after a Hex-upload completes, the just-Uploaded Hex is still there. So I guess after a Hex-Upload, it jumps to a point after the PIC does initial set-up memory-copying.
ortek_service is offline  
Old 2nd Apr 2023, 10:58 pm   #56
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,080
Default Re: Anyone building a PICL? more PCBs available

Sorry for the rambling repetitive misunderstanding Owen, I'd gone off on a complete tangent there

What you describe above is how Mikes version works, on Reset or power up, anything not [S]aved will be overwritten by the last saved Page1 and Page2:

Quote:
Originally Posted by Michael - K8LH View Post
The system loads the Page 1 and Page 2 image and the Kitbug+ Monitor into RAM during power-up then presents a [C]old, [W]arm, [K]itbug+ Monitor? prompt.

A program in Page 2 will Auto-Run when you select [W]arm start, assuming you've saved the Page 1 & Page 2 image. NIBL was designed to Auto-Run a program in Page 2 if it detects that Page 2 is ROM. We simply modified a single byte in the NIBL ROM image to bypass the test when selecting a [W]arm start.

The Sense B + Reset sequence Phil introduced in his PICL Version 2 update to provide Hex load capability now presents a [L]oad HEX, [S]ave to Flash? prompt. The [S]ave option copies an image of Page 1 and Page 2 RAM to the image store in PIC Flash memory and this is the image loaded into RAM during power-up or reset.
Cheerful regards, Mike McLaren, K8LH (Michigan, USA)
The reason it runs the light show, which is at 2800h, is that page 2 2000h-2FFFh has been cleared (probably to FF's, effectively a NOP) up to 2BFFh followed by KB+, by the 'load on reset' - and when you say 'G2200' the emulation runs through the FF's until it hits the lightshow code at 2800h.

Since memory is re-loaded from flash on Reset, the trick is load your hex file, then save it to flash by holding Sense-B, dab reset, and selecting [S]. Mike, would it be feasible to change this, so Reset leaves memory alone, and only on [W]arm does Page1 and Page2 get loaded?

Cheers
Phil

Last edited by Phil__G; 2nd Apr 2023 at 11:10 pm.
Phil__G is online now  
Old 3rd Apr 2023, 12:11 am   #57
ortek_service
Octode
 
ortek_service's Avatar
 
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 1,394
Default Re: Anyone building a PICL? more PCBs available

Thanks for the good explanation, which all makes sense.

Yes, this was all with Mike's version, that you'd prog'd into the F18877's for me.
(And I was going to have a look at the source files, but it seems I hadn't saved a couple of the initial one-byte patched one he'd posted, on this computer.)
But I wasn't sure how much was common with your PICL V2 F877 version (I've ordered a couple of cheap F877A's from a UK 'Bay seller, to play with as well / possibly use on a PIC14 or other project that still needs that particular one, without re-assembling code)

I had previously suggested that a 'Hot' restart option, that doesn't wipe / over-write parts of the RAM may be useful - Particularly also for NIBL BASIC Progs you haven't saved, although it seems only a couple of bytes (the first line no.) of NIBL Progs (in Page 1) get over-written (By Cold Start, as Warm start does copy a one-line program, so over-writes more?), so can at least do an 'OLD' via re-writing those 2 bytes (as detailed in your instructions, so I guess your PICL V2 PIC16F877 version did similar / NIBL does this at reset?).
ortek_service is offline  
Old 3rd Apr 2023, 1:21 am   #58
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,080
Default Re: Anyone building a PICL? more PCBs available

Mike will confirm but I think his NIBL code is unchanged other than the PAGE2-IS-ROM test, we did a lot of too-&-fro emailing at the time testing various updates but I dont recall any NIBL changes. In practise my own are mostly used for m/c anyway, NIBL is great as a novelty but I've found the PICLv2 a great platform for playing with scamp code.
Yes the 877 version just overwrites the first 3 bytes of each page on reset, whereas Mikes loads both pages from whatever is stored in flash.

I'm hoping we will have a new member here tomorrow, I've just been chatting with a genuine SC/MP enthusiast who wasnt aware of this forum, he's built quite an elaborate SC/MP system and has lots to show & tell
Cheers
Phil
Phil__G is online now  
Old 3rd Apr 2023, 6:03 pm   #59
DavidMS
Pentode
 
Join Date: Nov 2022
Location: Chesham, Buckinghamshire, UK.
Posts: 135
Default Re: Anyone building a PICL? more PCBs available

Looking for a bit of advice, I have been having problems reliability 'transfering' NIBL programs to my PICL. The initial problems were certainly down the terminal problem but even with TeraTerm I have a problem. I am sure this has nothing to do with the PICL or NIBL but would be grateful for any suggestions. It looks like the file is initially sent correctly but then further additional data is sent which often corrupts NIBL. I have looked at the file with a hex viewer and all looks fine with no extra garbage at the end. Lines are terminated with CR and LF - Any thoughts ?

TeraTerm is set to 3mS / 300ms - extending these further does not help - and I am using the 'transfer' command which is I assume correct ?
DavidMS is offline  
Old 3rd Apr 2023, 6:15 pm   #60
Phil__G
Octode
 
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 1,080
Default Re: Anyone building a PICL? more PCBs available

Just 'File' 'Send file' David

'Transfer' is for protocols like xmodem, kermit etc whereas 'File, Send file' just spools ascii text which is what we want

Cheers
Phil

PS Also, you can copy & paste - highlight the NIBL code in notepad, ctrl/C, go into Teraterm, Alt/V

PPS Also you can copy & paste from the Teraterm buffer, say you listed a program but then accidentally typed NEW (like you do) you could scroll back through the buffer, click&drag to highlight just the listing, Alt/C then Alt/V

PPPS - ¡ ƃuıʎɐןd ʇsnɾ ɯ,I - ɥɐu....

Last edited by Phil__G; 3rd Apr 2023 at 6:26 pm.
Phil__G is online now  
Closed Thread

Thread Tools



All times are GMT +1. The time now is 4:19 pm.


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.