![]() |
![]() |
![]() |
|
Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment. |
![]() |
|
Thread Tools |
![]() |
#101 | |
Pentode
Join Date: Nov 2022
Location: Chesham, Buckinghamshire, UK.
Posts: 124
|
![]() Quote:
![]() 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. |
|
![]() |
![]() |
![]() |
#102 |
Heptode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 598
|
![]()
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. |
![]() |
![]() |
![]() |
#103 |
Pentode
Join Date: Nov 2022
Location: Chesham, Buckinghamshire, UK.
Posts: 124
|
![]()
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
|
![]() |
![]() |
![]() |
#104 |
Heptode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 598
|
![]()
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. |
![]() |
![]() |
![]() |
#105 |
Heptode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 598
|
![]()
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) . Last edited by Phil__G; 3rd May 2023 at 11:52 pm. |
![]() |
![]() |
![]() |
#106 |
Heptode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 598
|
![]()
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. |
![]() |
![]() |
![]() |
#107 |
Pentode
Join Date: Nov 2022
Location: Chesham, Buckinghamshire, UK.
Posts: 124
|
![]()
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
![]() |
![]() |
![]() |
![]() |
#108 |
Heptode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 598
|
![]()
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 ![]() |
![]() |
![]() |
![]() |
#109 |
Heptode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 598
|
![]()
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. |
![]() |
![]() |
![]() |
#110 |
Heptode
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 888
|
![]()
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 |
![]() |
![]() |
![]() |
#111 | |
Heptode
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 888
|
![]() Quote:
Code:
10 PRINT STAT 20 GOTO 10 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. |
|
![]() |
![]() |
![]() |
#112 |
Heptode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 598
|
![]()
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 ![]() Code:
. .. ... CSA ; CHECK FOR SENSE A ANI 16 JNZ START JS P3,0X2C00 ; RETURN TO KITBUGPLUS IF SENSE A ... .. . ![]() Cheers Phil |
![]() |
![]() |
![]() |
#113 | |
Heptode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 598
|
![]() Quote:
![]() Last edited by Phil__G; 7th May 2023 at 6:34 pm. |
|
![]() |
![]() |
![]() |
#114 | |
Heptode
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 888
|
![]() Quote:
- 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. |
|
![]() |
![]() |
![]() |
#115 | |
Heptode
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 888
|
![]() Quote:
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. |
|
![]() |
![]() |
![]() |
#116 |
Heptode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 598
|
![]()
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. |
![]() |
![]() |
![]() |
#117 |
Heptode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 598
|
![]() 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 > |
![]() |
![]() |
![]() |
#118 |
Heptode
Join Date: Mar 2011
Location: North Yorkshire, UK.
Posts: 598
|
![]()
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) Last edited by Phil__G; 10th May 2023 at 2:29 am. |
![]() |
![]() |
![]() |
#119 | |
Heptode
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 888
|
![]() Quote:
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. |
|
![]() |
![]() |