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

DSPIC33CH128MP202 share ADC pin between master and slave

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
AlastairM



Joined: 28 Apr 2008
Posts: 32

View user's profile Send private message

DSPIC33CH128MP202 share ADC pin between master and slave
PostPosted: Tue Jan 21, 2025 6:03 am     Reply with quote

Is it possible to share (internally) an ADC pin in the slave and master code?
e.g. pin1
master:AN1/RA1
slave:S1AN15/S1RA1
Or does the CPRA fuse setting mean that the pin is physically 'master' or ''slave' and just not available for the other core?
I wanted the master to monitor the waveform frequency in the background while the slave samples
I have a spare pin for an external connection but I'd prefer not mod the pcb...
Thanks
Alastair
temtronic



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

View user's profile Send private message

PostPosted: Tue Jan 21, 2025 7:18 am     Reply with quote

yessh , I have enough 'fun' with one PIC in a package and you have TWO !!
Honestly, I'd look at the 'drawings' in the datasheet, only what, 5-6-700 pages to scan.......
What you ask seems 'possible', actually a good 'feature'. I know some PICs can 'interconnect' internal peripherals(her that here) so it 'might' be possible.

My first thought was of course a jumper.....that's what a 'dinosaur' like me uses !

edit. sigh, I downloaded the datasheet..834 pages !!!! I tried to scan,to see if the ADC s could be linked but yeesh, 'it's complicated' !!! sorry....
I want to got back to 16C84s !!!
AlastairM



Joined: 28 Apr 2008
Posts: 32

View user's profile Send private message

PostPosted: Tue Jan 21, 2025 8:08 am     Reply with quote

I found that bit of the datasheet quite confusing...
I'll try a few configurations on the actual hardware and come back after I've finished 'hacking'
Ttelmah



Joined: 11 Mar 2010
Posts: 19649

View user's profile Send private message

PostPosted: Tue Jan 21, 2025 8:12 am     Reply with quote

I suspect you probably can. Obviously only on a pin that is accessible both
to the master ADC and a slave ADC. However I'd also suspect that the
accuracy may well be degraded slightly.if you do this..There will be some
noise introduced when the sample and hold connects and disconnects, so
for a low accuracy application it might be OK. It is noticeable that the
examples from MicroChip, where they want something controlled by a
voltage always work from one core, and send the result to the second
core.
AlastairM



Joined: 28 Apr 2008
Posts: 32

View user's profile Send private message

PostPosted: Tue Jan 21, 2025 8:53 am     Reply with quote

You're correct about the signal integrity - but I'll live with it for now.
It worked OK on the hardware!
I now have the slave sampling continuously and the slave sample rate being changed by the master using the mailbox interrupt when the master sees a change in the waveform.
I think the #FUSES CPRA & CPRB are just relevant for IO pins to stop the cores fighting - the compiler doesn't complain when used for ADC. Interesting...
AlastairM



Joined: 28 Apr 2008
Posts: 32

View user's profile Send private message

PostPosted: Tue Jan 21, 2025 9:00 am     Reply with quote

dsPIC33CH128MP202 2-core 200MHz lots of goodies
28-pin SOP - ridiculous Razz
temtronic



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

View user's profile Send private message

PostPosted: Tue Jan 21, 2025 9:15 am     Reply with quote

NUTs..200 MHz. need to be careful about PCB layout and cleanliness at that speed

My remote energy control system ran at 24 BAUD. yes 24 bits per second.

sigh....I miss the good old days....

enjoy you're making PROGRESS !!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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