EEVblog > EEVblog Specific

EEVblog #1144 - Padauk Programmer Reverse Engineering

<< < (285/286) > >>

js_12345678_55AA:

--- Quote from: LovelyA72 on January 17, 2022, 09:49:38 pm ---It's kinda quiet here...

I am currently trying to make audioplayer work on a PFS154.
However, the example does not work at all. After probing on the SPI line I found that not only the timing is a mess, the padauk is driving the MISO pin which it needs to be listening to instead of driving.

I am wondering this might be a compiler issue since I can't see any pin manipulation on the MISO pin.

--- End quote ---

Do you use a recent version of SDCC?

I learned the other day that assembler syntax for IO commands was changed around July 2021 (e.g. "mov.io  IOREG, A" instead of the previous "mov IOREG,A").
=> Recent SDCC versions (snapshot / compiled from source) will most likely produce defect output when assembler language is included in your source code.

You should check the compiler output for warnings about IO register forced to be in memory... (unfortunately the will not be shown with default settings)

To fix this you only need to find all assembler code which contains MOV, T0SN, T1SN, XOR which have an IO register as source or destination. The new syntax for them is "mov.io / t0sn.io / t1sn.io / xor.io"

JS

P.S: Unfortunately updating all existing projects right now is not a good idea, since the stable release version of SDCC does not support the new ".io" syntax :-(


In case you mean the "audioplayer" from showcase projects, you need to change in "pdkspi.c" the assembler function "pdkspi_sendreceive":


--- Code: ---uint8_t pdkspi_sendreceive(uint8_t s)
{
  __asm
     mov a, #8                                 ; loop 8 times
1$:
     set0.io _ASMS(SPI_PORT), #(SPI_OUT_PIN)   ; SPI-OUT = 0
     t0sn _pdkspi_sendreceive_PARM_1, #7       ; s.7==0 ?
     set1.io _ASMS(SPI_PORT), #(SPI_OUT_PIN)   ; SPI-OUT = 1
     set1.io _ASMS(SPI_PORT), #(SPI_CLK_PIN)   ; SPI-CLK = 1
     sl _pdkspi_sendreceive_PARM_1             ; s<<=1
     t0sn.io _ASMS(SPI_PORT), #(SPI_IN_PIN)    ; SPI-IN==0 ?
     set1 _pdkspi_sendreceive_PARM_1, #0       ; s.0=1
     set0.io _ASMS(SPI_PORT), #(SPI_CLK_PIN)   ; SPI-CLK = 0
     dzsn a                                    ; loop--
     goto 1$                                   ; loop again if>0
  __endasm;
  return s;
}
--- End code ---

js_12345678_55AA:
I changed all showcase projects: https://github.com/free-pdk/easy-pdk-showcase-projects

They now use the new .io assembler syntax and require a recent SDCC version (>=4.1.10) for compilation.

I also added a workaround in the polysound project for the compiler bug / regression with incorrect working scoping of enums ( https://sourceforge.net/p/sdcc/bugs/3289/ )

JS

spth:

--- Quote from: js_12345678_55AA on January 21, 2022, 08:31:50 am ---P.S: Unfortunately updating all existing projects right now is not a good idea, since the stable release version of SDCC does not support the new ".io" syntax :-(

--- End quote ---

You could use e.g.


--- Code: ---#if __SDCC_REVISION >= 12558
mov.io-style asm code
#else
mov-style asm code
#endif

--- End code ---

spth:
Yesterday, SDCC 4.2.0 was released. There were no fancy new features particularly relevant to the pdk ports, though.

Development continues after the release , and the STM8 just got support for ISO C23 bit-precise integer types. Those could be useful for Padauk devices once ported, as they allow e.g. the use of 24-bit and 40-bit integer types.
P.S.: SDCC also allows bit-fields of bit-precise integer types, so they are also a way to have bit-fields wider than int.

LovelyA72:
Just a quick update, PMS150C(both SOP-8 and SOT-23-6) is back in stock in lcsc with sufficient stock.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version