Smartpin mode sync serial pin issues
I'm dabbling with smartpins for the first time. I have a SPI connection between a Raspberry PI 4 and the P2. The PI is the Controller, P2 is device (I prefer that over master/slave).
I can see the clock and data lines working. I generate random data on the CODI-line, and both CLK and CODI look great on the scope.
So I pulled up the smart pin documentation by Jon Titus and learned about the sync serial pin mode. I use his example to sample from the clock-pin with the following pasm method:
con CLK = 10 CODI = 11 pri spi_test() org ' output on pins 56-59 mov dirb, ##$0f00_0000 .smartpin dirl #CODI 'Reset receiver Smart Pin wrpin sync_rx_mode, #CODI 'Set sync receiver mode wxpin #%1_00111, #CODI 'Set receiver to sample on B- ' input edge dirh #CODI 'Enable Smart-Pin sync receiver .test_loop testp #CODI wc 'Wait in loop IN flag = set nop if_nc jmp #.test_loop 'If no C flag, repeat testing rqpin rcvd_data, #CODI 'Put 32-bit data (see text) in mov outb, rcvd_data 'Send 8 bit data to LEDs jmp #.test_loop 'Continue to rcv and display ' data sync_rx_mode long %0000_0101_000_0000000000000_01_11101_0 rcvd_data long $00 end
According to the documentation the BBBB selects normal logic, -1 from the pin number - and CLK is pin 10.
Now when I look at the CODI-line with my scope, the signal is severely dampened.
Any idea what's going on here?
Also: currently clock is not touched in any way, as I figured that it would by default be an input, and that's that. But is this correct, or do I need some sort of smartpin-input-mode for CLK as well?