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 support@ccsinfo.com

Mod ( % ) and uint64_t
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bkamen



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

View user's profile Send private message

PostPosted: Mon Apr 19, 2021 12:08 am     Reply with quote

temtronic wrote:
it has got me wondering, if someone's got a 'math coprocessor' for PICs....


That would be hilarious to design into a small FPGA or something.

let's say we wanted to do mult/div two 32 or 64bit numbers....

So we SPI rattle those to an FPGA with a command for which operation and then pick up a result of some size.

LoL..... Worth it?

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
bkamen



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

View user's profile Send private message

PostPosted: Mon Apr 19, 2021 12:13 am     Reply with quote

Speaking of which --

I updated some code in someone else's project like 11-12yrs ago.

Embedded Linux based gizmo that had to pick up readings from a LTC1859 ADC.

The original code had use of an SPI port, but did all the chip selects and hand shaking in software polling along.

The time it took to read 8 registers of 16bit data was something like 500uS-1mS.

All those blocking delays in the code. (oy!)

I ended up writing code for the FPGA the ADC was hooked to that the CPU had to go through to access the ADC that would just auto-run and get all the readings automatically all the time. The only moments it stopped was when the CPU was reading a result register.

This now happened in about 4uS. Woot. That was fun.
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
temtronic



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

View user's profile Send private message

PostPosted: Mon Apr 19, 2021 9:35 am     Reply with quote

'worth it' ?
probably, providing the FPGA was coded correctly, it 'should' be a LOT faster than a PIC doing the calculations and SPI xfers are fast....

editted....

i did a quik google....

seems there were FPUs for PICs ( PICAXE had one...), though no mention as to speed of calculations..... Also found a PIC32 with FP 'engine' under the hood..
I suspect the PICAXE chip would have been no better than the routines CCS supplies,rather just an easy way,to get a small PIC to do some high powered 'math'.

Depending on the need for speed, it 'might' be worth it to 'offload' the math to a 'coPIC', allowing the master PIC to do 'main' functions, while coPIC crunches the numbers. Fortunately, none of my projects are that 'mathmatically complicated'.


Last edited by temtronic on Tue Apr 20, 2021 5:21 am; edited 1 time in total
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Tue Apr 20, 2021 1:05 am     Reply with quote

Seriously though it'd be a large FPGA.
Even a basic 16bit arithmetic unit uses several hundred gates. The old
Intel FPU for the 386, had 120000 transistors in it.
There are libraries for FPGA floating point. These first became available
about 20 years ago, when the first FPGA's were launched that had enough
gates to build these.
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 Previous  1, 2
Page 2 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