Smart-Pin DAC with Noise
For several hours I have tried and failed (see code below) to get a Smart-Pin to produce what I think it should in the DAC_MODE = DAC Noise setting. Documentation doesn't include an example, and most of the Forum comments haven't helped. I assume I should see random voltages on my scope, but all I see is a short logic-0 pulse on the P20 output when the program starts. I'm revising the SMART PIN section of the v33 documentation, but it's difficult without an assembly-language program I can use as an example, test on my P2 board, and explain. I welcome a working example with comments. It will help others, too. Thanks. --Jon
CON freq = 160_000_000 dat org 0 dirl #20 'Set DAC at Smart-Pin P20 wrpin DACconfig, #20 nop wxpin DACperiod, #20 nop wypin DACvolt, #20 dirh #20 .myloop nop jmp #.myloop DACconfig long %0000_0000_000_10100_00000000_01_00010_0 'Random dither 'DACconfig long %0000_0000_000_10100_00000000_01_00011_0 'PWM dither DACperiod long $0000_0000_0000_0000 ' X15:X0, no period? DACvolt long $0000_0000_0000_FF00 ' Bits Y15:Y0, voltage? How set?