PICAXE-08M2 DAC sample rate

dvd

New Member
I would like to send a pre-code signal at a fixed sample rate to the ADC.

  1. I am trying to understand what the upper sample rate is of the DAC on the 08M2 (or any other picaxe chip).
  2. How do I control said sample rate? Do I just introduce a pause between writing samples?
  3. Can anybody point me to a code example for this?
 

hippy

Technical Support
Staff member
I am not sure anyone has actually measured the maximum update rate of the DAC. It is basically however quickly you can issue DACLEVEL commands and you could use PAUSE or PAUSEUS commands between DACLEVEL commands.

This test programs sets the DACLEVEL 100 times consecutively on an 18M2 at 4MHz -

Code:
#Picaxe 18M2
#No_Data

#Define DAC2    DacLevel 31 : DacLevel 0

#Define DAC10   DAC2   DAC2   DAC2   DAC2   DAC2
#Define DAC50   DAC10  DAC10  DAC10  DAC10  DAC10
#Define DAC100  DAC50  DAC50

; DAC output on C.2 leg 1
; SYN output on C.1 leg 18

DacSetup %10100000 ; 0V / V+
Do
  High C.1
  DAC100
  Low C.1
  Pause 10
Loop
The high pulse on C.1 lasts just about 54.6ms so it's a DAC update about every 546us at 4MHz. About every 70us at 32MHz.

DAC.jpg
 
Top