AnsweredHot!Porting help, 16f877 -> 16f18877

Author
__angelo__
Starting Member
  • Total Posts : 71
  • Reward points : 0
  • Joined: 2010/12/02 02:39:25
  • Location: 0
  • Status: offline
2018/10/30 01:09:59 (permalink)
0

Porting help, 16f877 -> 16f18877

Dear all,
 
have to port a firmware (written in asm) from 877 to 18877, do you have an suggestion that can help me on this ?
 
Right now, i have seen:
- memory banks changes a lot, and so bank switch mechanism also, this seems the more tedious part to do
- FSR mechanism changes,
- eeprom read write mechanisms / regs also changes
- many other minor things of course.
 
For now as a starting point i could build for 18877 just skipping some parts, and changing FSR to FSR0L, but very likely, i need much more job.
So if you know any tool, method, etc to help me on this, it's very welcome.
 
Regards,
angelo
 
#1
qhb
Superb Member
  • Total Posts : 9682
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: Porting help, 16f877 -> 16f18877 2018/10/30 02:08:07 (permalink) ☼ Best Answerby __angelo__ 2018/10/30 06:21:30
+1 (1)
angel70
- memory banks changes a lot, and so bank switch mechanism also, this seems the more tedious part to do

If you had used the BANKSEL macro in your original code, this would have been fairly trivial. Do it now. :)
 

- FSR mechanism changes,

Yes, but the new method is a lot more powerful, so it's easy to reproduce the old behaviour.

- eeprom read write mechanisms / regs also changes

If you use a central read and write function, then this only needs updating in one place.
 
Of course, if you use this as a motivation to move to C, it's win-win! ;)
 
#2
__angelo__
Starting Member
  • Total Posts : 71
  • Reward points : 0
  • Joined: 2010/12/02 02:39:25
  • Location: 0
  • Status: offline
Re: Porting help, 16f877 -> 16f18877 2018/10/30 03:17:17 (permalink)
0
Hi qhb,
 
many thanks !
 
Well, there are several functionalities, something bitbanged, some logic, moving all to C would be nice but likely may require more time.
(It's a pity the C compiler is not free, while asm compiler seems to be still free)
#3
qhb
Superb Member
  • Total Posts : 9682
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: Porting help, 16f877 -> 16f18877 2018/10/30 03:20:58 (permalink)
+2 (2)
The C compiler IS free, you just have to pay to get the more advanced optimisation levels.
It's easy to include inline assembly to handle any strct requirements (like bit banged I/O) that you have toruble moving to C.
 
#4
__angelo__
Starting Member
  • Total Posts : 71
  • Reward points : 0
  • Joined: 2010/12/02 02:39:25
  • Location: 0
  • Status: offline
Re: Porting help, 16f877 -> 16f18877 2018/10/30 04:04:32 (permalink)
0
Ok thnaks.
 
Still a question. I am moving from 18f877 to 18f18877 since the first is going hard to be found. Is there any other option in your knowledge (a chip more similar to 18f877 with an open life cycle, so i don't have to change the asm code) ? 
#5
qhb
Superb Member
  • Total Posts : 9682
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: Porting help, 16f877 -> 16f18877 2018/10/30 04:23:06 (permalink) ☄ Helpfulby __angelo__ 2018/10/30 06:21:22
+2 (2)
angel70
Still a question. I am moving from 18f877 to 18f18877 since the first is going hard to be found.

I assume you still mean 16F877 and 16F18877
The PIC16F877A is almost identical to the PIC16F877, and will be available for many years yet.
The PIC16F887 is also very similar, but with some nice extra features (like an internal oscillator, and more ADC)
 
However, I would not do a new PIC16F design on any chip that didn't start with PIC16F1
The new features are there for a reason, and make designing around these chips much nicer.
 
Have you seen the "PIC1XF1XXX Software Migration" guide?
http://ww1.microchip.com/...n/DeviceDoc/41375A.pdf
#6
__angelo__
Starting Member
  • Total Posts : 71
  • Reward points : 0
  • Joined: 2010/12/02 02:39:25
  • Location: 0
  • Status: offline
Re: Porting help, 16f877 -> 16f18877 2018/10/30 05:59:19 (permalink)
0
Really many thanks,
 
sorry for the lapsus, it's all 16f of course.
 
So if i understand, on PIC16F877A and PIC16F877 mi same "asm" recompiled may run right ?
This application is a very old design my company needs to keep active still some year, but without any maintenance on it, and without any big time-investment if possible. 
 
 
#7
1and0
Access is Denied
  • Total Posts : 8888
  • Reward points : 0
  • Joined: 2007/05/06 12:03:20
  • Location: Harry's Gray Matter
  • Status: offline
Re: Porting help, 16f877 -> 16f18877 2018/10/30 06:52:29 (permalink)
0
angel70
So if i understand, on PIC16F877A and PIC16F877 mi same "asm" recompiled may run right ?
This application is a very old design my company needs to keep active still some year, but without any maintenance on it, and without any big time-investment if possible. 

 
https://www.microchip.com/forums/m40417.aspx
 
#8
NKurzman
A Guy on the Net
  • Total Posts : 17162
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: Porting help, 16f877 -> 16f18877 2018/10/30 07:15:22 (permalink)
0
If you are concerned about availability the 877A is also an old PIC.
Are you concerned the the PIC16F877 will be discontinued?
#9
__angelo__
Starting Member
  • Total Posts : 71
  • Reward points : 0
  • Joined: 2010/12/02 02:39:25
  • Location: 0
  • Status: offline
Re: Porting help, 16f877 -> 16f18877 2018/10/30 08:50:12 (permalink)
0
 
NKurzman
Are you concerned the the PIC16F877 will be discontinued?


Yes
#10
NKurzman
A Guy on the Net
  • Total Posts : 17162
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: online
Re: Porting help, 16f877 -> 16f18877 2018/10/30 08:59:08 (permalink) ☄ Helpfulby __angelo__ 2018/10/31 01:21:23
+2 (2)
As far as I know Microchip has not end of lifed any pics except for the window packages. They are kind of known for that.
So you have time. A newer chip will cost you less.
#11
__angelo__
Starting Member
  • Total Posts : 71
  • Reward points : 0
  • Joined: 2010/12/02 02:39:25
  • Location: 0
  • Status: offline
Re: Porting help, 16f877 -> 16f18877 2018/10/31 01:21:12 (permalink)
0
Many thanks all for the support.
I think moving from 5$ to 1,1 per piece may have sense, a production of some hundreds pcs should pay back the porting job.
 
 
#12
mlp
boots too small
  • Total Posts : 719
  • Reward points : 0
  • Joined: 2012/09/10 15:12:07
  • Location: previously Microchip XC8 team
  • Status: offline
Re: Porting help, 16f877 -> 16f18877 2018/11/01 09:08:40 (permalink)
+2 (2)
NKurzman
As far as I know Microchip has not end of lifed any pics except for the window packages.

One thing I got from the fab tour when I was at MASTERs last year: storage for old reticules (masks) seems to be the fastest-growing area of the fab. They can build new instances of even their oldest chips for as long as you can pay.

Mark (this opinion available for hire)
#13
__angelo__
Starting Member
  • Total Posts : 71
  • Reward points : 0
  • Joined: 2010/12/02 02:39:25
  • Location: 0
  • Status: offline
Re: Porting help, 16f877 -> 16f18877 2018/11/01 15:06:42 (permalink)
0
Good, many thanks !
#14
Jump to:
© 2019 APG vNext Commercial Version 4.5