Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. // sam3s adc characteristics: 41.7 (1058ff)
  2. // max adc frequency: 20mhz
  3. // max startup(standby -> normal mode): 12us
  4. // track and holding time (min): 160ns
  5. // settling: 200ns
  6.  
  7. // 20mhz maximal adc clock frequency ->
  8. // prescaler 0 not possible (32mhz) ->
  9. // use 16mhz adc frequency with prescaler 1
  10. #define ADC_PRESCALER 1
  11.  
  12. // 16mhz takes 192 clock cycles for 12 us ->
  13. // smallest possible value is 512 (32us)
  14. #define ADC_STARTUP ADC_MR_STARTUP_SUT512
  15.  
  16. // 16mhz takes 2.56 clock cycles for 160ns ->
  17. // Tracking Time = (TRACKTIM + 1) * ADCClock periods ->
  18. // smallest possible value is 2 (187.5ns)
  19. #define ADC_TRACKTIM 2
  20.  
  21. // 16mhz takes 3.2 clock cycles for 200ns ->
  22. // smallest possible value is 5 (312.5ns)
  23. #define ADC_SETTLING 1
  24.  
  25. // I can't find anything about the minimum transfer period...
  26. // Transfer Period = (TRANSFER * 2 + 3) ADCClock periods.
  27. // Transfer Period of 1 -> 312.5ns
  28. #define ADC_TRANSFER 1
  29.  
  30. // Alltogether, when 8 adc channels are used:
  31. // 32us + 8*187.5ns + 312.5*8ns = 36us
  32. // Maximum allowed trigger frequency is 28khz
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement