Use the AAAABBBB smartpin field for analog input?
Rayman
Posts: 14,646
Okay, maybe I wasn't paying close enough attention, but I thought that Rev.B could only get analog input from neighboring pin and that Rev.C could only get analog on it's own pin.
But, I seem to be able to use the smartpin AAAABBBB field to get analog input on Pin+1 and Pin+2 (at least).
Is this really possible? I think it must be, but I'm surprised...
But, I seem to be able to use the smartpin AAAABBBB field to get analog input on Pin+1 and Pin+2 (at least).
Is this really possible? I think it must be, but I'm surprised...
Comments
The ADC only works on the pin, itself (on Rev C silicon). However, you could grab the ADC output of another pin using these 8 bits.
I'm trying to figure out how my code is giving me an analog signal on P11 with nothing connected to it when I set AAAA to look at another pin...
The sigma-delta is actually a digital signal.
When Pin#9 smartpin is set for ADC mode, Pin#11 can see it's data using the AAAA field.
Is this possible?
Yes, it would need to be in ADC mode so that its IN output is the ADC bitstream.
I'm trying to think if this is useful for anything...
You could do that.
Without any jumper wires, I can look at the VGA signals using neighboring smartpins.
See attached image where bottom analog trace is looking at HSync and top is looking at the blue channel.
The cursors get close to the actual HSync freq of 67.5 kHz.
(shoot, wrong image... But trust me, the cursors show right freq).
First, I had to move A/V board over to P8..P15 from P0..P7 so that I could get to HSync and blue signals. Otherwise, I'd be messing with serial I/O pins. Maybe it could work that way, but this is cleaner.
Next, I needed to hijack the VGA smartpins from the VGA cog. Apparently, whichever cog does the WRPIN controls the ADC output via their OUT signal (This is what I think I'm seeing anyway). So, I need set OUT high and then write "dacmode_s" to HSync and then "dacmode_c" to blue pin. This is a bit tricky because you can lose video if you do HSync wrong.
Finally, set P6 and P7 to ADC scope mode with AAAA pointing to neighboring VGA pins.
Also, looking at the actual HSync in Blue pins in digital mode now shows noise, which must be the raw ADC bits...
Syncing off the start of VSync and shifting the trigger point to the right and then looking at the Blue signal... It appears there are only 3 front porch blanks when there are supposed to be 4.
Not sure I understand that... Code looks right:
I'm actually able to count lines after sync too and it's one too many... Simple fix though.
Therefore, the measured ticks at the end of the third command is for just first byte shifted out. The other two bytes/commands are still being processed by the streamer.
EDIT: Added screenshot