cancel
Showing results for 
Search instead for 
Did you mean: 

receiving DALI with the ST7dali

bleumers_j
Associate II
Posted on July 11, 2003 at 11:29

receiving DALI with the ST7dali

3 REPLIES 3
bleumers_j
Associate II
Posted on June 26, 2003 at 11:00

Hello,

I have problems receiving dali with the ST7dali. This MCU has a DALI-interface built in, so it should be simple.

It doesn't work so, i must be doing something wrong, but i can't find what.

There is a clean TTL-signal on the DALI-in pin. But no interrupt is generated, and the Interupt Flag stays low.

---- EDIT----: I found out the TTL signal was inverted. After correcting this sometimes data is written into the data en adress registers. But still no interrupt (IFT-bit itself stays low). Only FF and 00- values are written into the registers.

---END-OF-EDIT.

This is a part of the code:

DCMCLK = 207 ; @8MHz

DCMCSR = 0x80; // Bit 7 = Interupt enable Rest bits zijn R/O

DCMCR = 0x08; // Bit3 = 1 (DALI enable); Bit2 = 0 (ACKNOWLEDE); Bit1 = 0; (RECEIVE); Bit0 = 0

if (ValBit(DCMCSR,5)) // read Error flag

SchrijfPWM(1,255); // Led 1 on

else

SchrijfPWM(1,0); // Led 1 off

if (ValBit(DCMCSR,6)) // read Interupt flag

SchrijfPWM(2,255); // Led 2 on

else

SchrijfPWM(2,0); // Led 2 on

SchrijfPWM(3,DCMFD);

Greets.

[ This message was edited by: joble on 27-06-2003 10:26 ]
bleumers_j
Associate II
Posted on June 30, 2003 at 06:20

The problem is solved half, but other problems occur:

The interrupt module is called every time a broadcast of an ArcCommand '0' on the Dali-bus occures. But on every other Dali-command, only the error flag becomes high.

The internal RC oscillator is used with the PLLx8 function, so the ST7 runs at 8MHz. So the DCMCLK register should be set at 207.

Has anyone an idea what is goïng wrong.

----- EDIT:

New evolution:

When the ST7 is set at 4 MHz, and the DCMCLK is 104, also other dali commands cause an interupt. Sometimes a framing error occurs.

Anyone an idea why it works more or less at 4MHz and doesn't work at all at 8 MHz???

-----

Greets.

[ This message was edited by: joble on 30-06-2003 09:57 ]
paolo2399
Associate
Posted on July 11, 2003 at 11:29

Hi,

It seems like you did not calibrate the internal RC.

You should check if CPU frequency is OK.

This means, to output the fCPU on the MCO pin.

Let me know!

All the best

Paolo