This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

problem with SSC and ST10F269

Hello,
I've got following simple problem. I need to use SSC in my sw, but I cannot get it running. SCLK doesn't work. I measured output pins, but I'got still 5V. I'v got DP3.13=1, output latch of P3.13=1, SSCBR is counting, but no square signal on P3.13. SSCEN=1, everything is set according to manual and I thing correctly, but no SCLK and so no recieved data and so transmitted data. Thank you for your help and Ideas. Jan

  • Sorry if this is too simple, but are you writing to the transmit buffer while looking at the SCLK pin? The SPI protocol is synchronous so the SCLK is only active during the actual data transfer.

  • Hello,
    thank you for your answer. The problem is already resolved. It was not this problem. The initialisation of SSC must be before EINIT. First I had it after the instruction, next I moved it before, but I forgot to delete previous initialisation routine. Thank you anyway.
    Jan Marcol

  • "The initialisation of SSC must be before EINIT."

    Are you 100% sure that this is the right solution?

    Reinhard

  • Well, let me do some more tests. Yesterday when you advised me to do it before EINIT, I did it, but it didn't work. But few moments ago I worked on other task and I found that I had two initialisations of SSC. - I forgot to delete old one. So I deleted it, and it runs... I had SCLK on P3.13 on the right moments and also interrupts work properly... So it seems, that it was this.

  • This is interesting:
    We're actually porting a Keil C v4.26 project from the ST10F168 to the ST10F269 and face the same problem: no SCLK is available in case of master data transmission. On the ST10F168, the same code runs perfectly.
    The ODP register seems to be correct.
    I didn't find any hint nor in ST's forums, neither in the user manual.

    So, do you know what exactly Jan did to initialize the SSC or Jan: could you post your initialization routine?

  • Hello,
    it's already for me an old problem, but as remember well, in my case it was problem with initialization. First I had had the initialization before the execution of instruction EINIT.Then Reinhart adviced me to do it after EINIT. I did it but it didn't work, because I forgot to delete old initialization. From this point, so far, it works properly. I use SSC to communicate with PLC. Baudarate 1MBit I guess. On actual project I send to PLC 1 word and receive 8. I wrote several supporting macros for definitions and processing the transfered data. If you need the codes, write to forum your email address, I can send you it.
    Jan Marcol

  • Hello Jan,
    Thanks for your answer. I'm using the SSC with 1MBit, as well. The Initialization is after EINIT. We can see signal toggling on the SSC Tx line, but nothing on the SCLK.
    The most interesting for me would be the initialization part SSC because I think there could be a difference between ST10F168 and ST10F269.
    Since I can't post my email address into the forum, could you post the (maybe few) initialization instructions (or can KEIL give you my email address)?
    Thx,
    Hans-Dieter

  • Hello Hans-Dieter,
    last time I made a mistake. The initialization must be done BEFORE EINIT not after as I wrote last time. I mischanged it.... I do apologize....
    there can be a problem with ports. You must choose correct direction of ports that are used for SSC. I don't know ST10F168 but for
    ST10F269 are for SSC used P3.8, P3.9 and P3.13. P3.8 is for Master processor input, P3.9 and P3.13 are outputs. AS an initialization we use following sequence:

    extr #1
    mov SSCBR,#20 ;1us Baudrate
    bclr SSCEN
    mov SSCCON, #0100$0110$0010$1111b
    bset SSCEN

    This Sequence of instructions is placed in a Routine, that is called before the execution of EINIT.
    Jan