• AVR Freaks

Helpful ReplyHot!ADC coexistence issue with Ethernet

Author
D4ILYD0SE
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/02/12 15:34:09
  • Location: 0
  • Status: offline
2019/12/11 17:42:21 (permalink)
0

ADC coexistence issue with Ethernet

Hey, I'm having an issue with Harmony 2.06 ADC driver working with TCP drivers for my PIC32MX795
 
I'm using Scan Mode, Auto-Sampling, and it's Interrupt Driven.  The board I've designed is using up AN11, AN12, and AN13, for the PHY chip connections.  All ethernet/remote functionality works.  I've created a program to talk to the PIC32 and do various tasks and the PIC responds and everything is hunky dory.
 
Then I add the ADC driver.  I use AN2-AN9 on Scan Mode, Auto Sampling, and Interrupt Driven. I made Ethernet Interrupt Priority 7 and ADC Interrupt Priority 1 (I also tried the other way around).  Anyways, I cannot connect at all.  When I remove the ADC driver, everything is back to normal functionality.
 
Is there a secret to the ADC driver I don't know?  Or do I need to be setting it up differently based on my requirements?  Any suggestions?
#1
D4ILYD0SE
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/02/12 15:34:09
  • Location: 0
  • Status: offline
Re: ADC coexistence issue with Ethernet 2019/12/12 13:46:42 (permalink)
0
I'm very confident the issue is that pins 35, 41, 42 (AN11, AN12, AN13) are no longer being used for the TCP Stack/Internal MAC and are somehow being set for Analog Input.  I can't for the life of me figure out how to get them to not do that.
 
Any thoughts?  The ADC Driver I am only setting up scan mode for AN2-AN9.
#2
D4ILYD0SE
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/02/12 15:34:09
  • Location: 0
  • Status: offline
Re: ADC coexistence issue with Ethernet 2019/12/12 13:49:26 (permalink)
0
Is it possible SCAN Mode is enabling all Analog? My only concern with this theory is that pins 24 and 25 are AN0 and AN1 but they are also PGC1 and PGD1 which I am using for debugging without issue as far as I can tell.  So I feel like that would throw that out the the window.  There must be something funky with Harmony Drivers.
 
#3
Mysil
Super Member
  • Total Posts : 3546
  • Reward points : 0
  • Joined: 2012/07/01 04:19:50
  • Location: Norway
  • Status: offline
Re: ADC coexistence issue with Ethernet 2019/12/12 14:40:31 (permalink) ☄ Helpfulby D4ILYD0SE 2019/12/12 15:15:44
0
Hi,
I have a vague recollection that Ethernet stack did/do use the ADC to create some random seed value during initialization. I am not sure whether it did some actual measurements, or just did use the internal oscillator in ADC to make some time intervals to compare with system clock.
Anyway, this might leave the ADC in a configuration that isn't Reset default, and not configured as you may have tried to set it up. I think it do not use the ADC when running.
If you can find out when TCP/IP stack have finished initialization, and is no longer messing with the ADC,
I think you may do a full initialization of the ADC, and get control.
 
    Mysil
#4
D4ILYD0SE
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/02/12 15:34:09
  • Location: 0
  • Status: offline
Re: ADC coexistence issue with Ethernet 2019/12/12 15:17:07 (permalink)
0
Mysil
 
If you can find out when TCP/IP stack have finished initialization, and is no longer messing with the ADC,
I think you may do a full initialization of the ADC, and get control.
 
 

 
So I could definitely wait until connected to start the ADC if that's in fact true (I'll try it here in a sec).  But the next concern would be if a client disconnects.  From what I can tell, the TCP stack does not seem to recognize if a client has disconnected nor does it properly reset.  So I've been sending myself disconnect commands as well as monitoring a timer in case of accidental disconnect and then resetting the PHY.  I feel like this would be an issue with the ADC again.
#5
D4ILYD0SE
Starting Member
  • Total Posts : 34
  • Reward points : 0
  • Joined: 2019/02/12 15:34:09
  • Location: 0
  • Status: offline
Re: ADC coexistence issue with Ethernet 2019/12/12 15:33:08 (permalink)
0
Ok, quick update.  I configured my code for the ADC to "OPEN" and "START" once there was a connection from a client.
 
I was able to remotely connect, received my connection message and then the connection was instantly dropped.  Again, I suspect it's got something to do with the ADC driver.
#6
Jump to:
© 2020 APG vNext Commercial Version 4.5