CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

A Special question about "FPGA and 16F877"
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ressas



Joined: 15 Nov 2019
Posts: 135

View user's profile Send private message

A Special question about "FPGA and 16F877"
PostPosted: Sat Aug 15, 2020 12:01 pm     Reply with quote

A question that has been on my mind for a long time;
Is it possible to design a mcu architecture with FPGA.
For example, can I design the architecture of the 16f877 with an FPGA?
If yes, can I use the chip in the FPGA as the mcu at the end of the project?
And how long will such a project end?
Ttelmah



Joined: 11 Mar 2010
Posts: 19546

View user's profile Send private message

PostPosted: Sat Aug 15, 2020 12:49 pm     Reply with quote

Yes.

Some years ago, I built a couple of processors using FPGA's. In both cases
the manufacturer was prepared to supply the core logic diagrams for
the chips. One was a (now fairly old) PIC.
However generally, will cost a lot more than the chip itself. Remember a
lot of gates are needed for things like memory.....
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Aug 15, 2020 3:42 pm     Reply with quote

As Mr. T. says , yes you can do it however.....
...an upgraded, newer version PIC can be bought for about $2. How many 1,000s of manhours are YOU going to invest in the FPGA-PIC ???
A proper,100% 'clone' will be very, very time consuming and costly !!
Odds are real good even after 2 soild years od 10hr dayze ,YOU still won't have a viable product.
It's a whole lot easier to get a PIC to emulate something, a HUGE task to get an FPGA to mimic a PIC, even a 'simple' 16F877.
ressas



Joined: 15 Nov 2019
Posts: 135

View user's profile Send private message

PostPosted: Sun Aug 16, 2020 10:03 am     Reply with quote

Thank you for answers.
I dont have "2 soild years od 10hr dayze"
How about for 16f84a.
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Aug 16, 2020 10:19 am     Reply with quote

Anything is possible and the 16F84 is a lot simpler BUT to what end ? Odds are real good you'll not get 100% of it correct...Obvious place to start is 'simple' timing and I/O, of course you'll have to get ICSP working first though....

Then there's the parts cost. I'm betting an FPGA that might emulate the PIC will cost a LOT MORE than a 16F84, so from an 'economic' viewpoint NOT viable.

While it might make an interesting thesis or final project, it's just not economical.
Ttelmah



Joined: 11 Mar 2010
Posts: 19546

View user's profile Send private message

PostPosted: Sun Aug 16, 2020 11:09 am     Reply with quote

OpenCores has a design for that.

<https://opencores.org/projects/risc16f84>
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Aug 16, 2020 3:00 pm     Reply with quote

gee, replacing a $5 PIC with a $62 FPGA just doesn't seem cost effective AND you have to program it. Then there's the PCB design to make it 'pin compatible'. I quickly scanned the article and unless you started with it, I still think 1-2 man years , to get an FPGA to emulate the PIC.

BTW seems the 16F84 is 'not recommended for new designs'...
..sigh, I'm old , I remember when they came out and said 'goodby' to my EPROM eraser...

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19546

View user's profile Send private message

PostPosted: Mon Aug 17, 2020 1:45 am     Reply with quote

FPGA's, and particularly ASIC's, have plummeted in cost recently, so if you
need one, and want to capabilities of a PIC, it may be worth going this route.
However given the price of newer larger PIC's, and the sheer amount of
work involved in writing a replacement for one of these, I'd honestly say
much easier to use the PIC, and a smaller FPGA....
ressas



Joined: 15 Nov 2019
Posts: 135

View user's profile Send private message

PostPosted: Tue Aug 18, 2020 10:51 pm     Reply with quote

Actually i don't want a chip that i will use in the industry.
What I want is to learn the details of FPGA and an MCU.
So the price of FPGA I will buy once is not that important.
Instead of making an MCU with FPGA, I'd love to hear if you have any other project suggestions that will learn both.
If not, I think I could devote 4 hours a day and 1 year to this job. (16f84a)
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Tue Aug 18, 2020 10:59 pm     Reply with quote

Then buy one of the starter kits.

I do a lot of design on Xilinx FPGAs. They have fun-kits.
Like maybe a Spartan 6 series if you want a Soft-Core CPU (like the microblaze) or the Series 7 like a Zynq-010 board (which has hard-core ARM CPUs built into the glass).

I've also been to workshops for Altera (now owned by Intel) and their FPGAs are fun.
Same thing here.. there are kits where you can choose free [spam] CPUs or hardCore CPUs (typically ARM) on the die.

I know Microchip has FPGAs now... but I've not played with them at all yet. I was busy in XilinxLand at the time.

Microchip is on my list to review.

So many toys, so little time.

Oh - and buy a book on Verilog. :D (or VHDL if you like).

FPGAs are a lot of fun.

As someone already mentioned, OpenCores.Org is fun to browse too.
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
Ttelmah



Joined: 11 Mar 2010
Posts: 19546

View user's profile Send private message

PostPosted: Wed Aug 19, 2020 2:52 am     Reply with quote

A complete PIC, even a very small one, is a hell of a big project.
You need to start with much smaller pieces. Binary adder, shift register,
memory cell, etc. etc.. The individual bits a thousand or more of which
would be needed to make even the most basic processor.
I built my first processor exactly that way, using discrete logic (before
microprocessors existed).

It's worth understanding just how complex even a small PIC really is.
You are probably looking about 30000 transistors.....
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Aug 19, 2020 5:03 am     Reply with quote

re: ...You are probably looking about 30000 transistors.....

find ( buy ??) a PIC16C84, then you CAN see what's 'under the hood', or in this case, the quartz window .

I actually have some Microchip PLA that I need to 'blast' to make a HD interface between my TRS80 and the 15MB HD..... have the code,not the programmer..

sigh...way too many PIC projects.....and time DOES get shorter , the older you get !!!

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19546

View user's profile Send private message

PostPosted: Wed Aug 19, 2020 7:41 am     Reply with quote

I don't think 'time gets shorter', I think extra jobs come along to use it.
When you are young, an amazing amount of stuff is done for you by your
parents. Then when you go to uni, if something goes wrong with the
plumbing, it is the landlords responsibility. It's only when you own your
own house, that the dripping tap, or the blocked drain, has to be fixed
by you. At the same time if you are competent, friends, and neighbours
learn that you can 'do things', and magically these start to appear....
Today, I lost two hours, fixing the neighbour's television, and then
unblocking a downpipe. Sad
ressas



Joined: 15 Nov 2019
Posts: 135

View user's profile Send private message

PostPosted: Wed Aug 19, 2020 11:02 pm     Reply with quote

How many hours do you devote to electronics (work) a day?
Do you think you're wasting time spent outside of work?
I think you really know the value of time.

Also, if you have a belief in "HEAVEN", you can continue these works after you die. Very Happy
Hope true belief in heaven takes you straight to heaven Very Happy
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Aug 20, 2020 4:50 pm     Reply with quote

I can handle the downpipe but gee FIXING a TV ? Unless it has 'valves' in it, I'm lost Laughing
I did diagnose wife Nissan's electrical probalem to faulty CAN bus communications or wiring... thought about building a PIC-CAN sniffer but soon lost interest after I loaded 1,000+ concrete pavers onto a truck....
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group