Proton BASIC Community

Proton (Positron) => Lounge => Topic started by: GDeSantis on Oct 16, 2024, 08:29 PM

Title: Request for Shin command modification
Post by: GDeSantis on Oct 16, 2024, 08:29 PM
Per the Positron 8-Bit manual, the syntax for the inline Shin command is as follows:

     Var = Shin Data_Pin, Clk_Pin, mode, shifts

Where "shifts" informs the Shin command how many bits to shift into the assigned variable and can be specified from 1 to 16.

Since I would like to use the Shin command to clock out data from a 22 bit ADC, the 16-bit limitation is a problem. 

Moreover, since I am looking at other applications where a 32 bit shift would be required, please consider a Shin command modification on a future Positron update.
Title: Re: Request for Shin command modification
Post by: Frizie on Oct 17, 2024, 01:59 PM
You can split a DWORD variable, right?
Suppose you want to receive 32 bits in DWORD MyDword.
You will get something like:

Shin Data_Pin, Clk_Pin, mode, [MyDword.LowWord\16, MyDword.HighWord\16]
Title: Re: Request for Shin command modification
Post by: GDeSantis on Oct 17, 2024, 02:21 PM
I checked your suggestion and it seems to work very well.  Thank you.