Probleme mit MIRF Treiber MIRF24port

  • 1
  • 2
  • 3
  • 4
  • Page 3 of 4
wom
 
Avatar
 
Subject:

Re: Probleme mit MIRF Treiber MIRF24port

 · 
Posted: 15.01.2011 - 13:50  ·  #17
Hallo Miparo,

auch mit zwei neuen MIRF24 habe ich keine Erfolg. Die Dinger laufen einfach nicht. Derzeit kann ich nicht sagen, an was es liegt. Kann es sein, dass der Treiber (Compiler 4.99.28) ein Problem mit meiner Applikation hat ?

mega32,
ProcClock = 16000000; {Hertz}
SysTick = 10; {msec}
StackSize = $0064, iData;
FrameSize = $0064, iData;
SPI_Soft,
PortC, 2, 3, 4, 1, 0, 5;

Auf PortC ist beim mega32 der TWI (SCL/SDA) ??
wom
 
Avatar
 
Subject:

Re: Probleme mit MIRF Treiber MIRF24port

 · 
Posted: 02.03.2011 - 09:48  ·  #18
Hallo Miparo,

mit dem neuen Compiler ist alles ok. Es lag nicht an der Applikation sondern am Compiler. Hat mich einiges an Zeit gekostet.

gruß
WOM
miparo
Administrator
Avatar
Gender:
Location: Germany
Age: 59
Posts: 957
Registered: 09 / 2007
Subject:

Re: Probleme mit MIRF Treiber MIRF24port

 · 
Posted: 02.03.2011 - 12:49  ·  #19
Hallo wom,
das passiert leider bei der riesigen xMega Umstellung.

Dafür weisst Du jetzt wie es funktioniert :)


Gruß
miparo
wom
 
Avatar
 
Subject:

Re: Probleme mit MIRF Treiber MIRF24port

 · 
Posted: 04.03.2011 - 09:08  ·  #20
Hallo miparo,

ich war da etwas zu schnell. Geht immer nich nicht.

gruß
wom
miparo
Administrator
Avatar
Gender:
Location: Germany
Age: 59
Posts: 957
Registered: 09 / 2007
Subject:

Re: Probleme mit MIRF Treiber MIRF24port

 · 
Posted: 05.03.2011 - 00:41  ·  #21
Quote by wom

Hallo Miparo,

mit dem neuen Compiler ist alles ok. Es lag nicht an der Applikation sondern am Compiler. Hat mich einiges an Zeit gekostet.

gruß
WOM


Quote
Hallo miparo,

ich war da etwas zu schnell. Geht immer nich nicht.

gruß
wom


Hi wom,
woher der Sinneswandel ? :)

Es hat ja mal funktioniert ?
Hast Du mal die Demos mal probiert ?

Bei mir laufen die mit dem aktuellen Compiler.

Nach dem flashen immer kurz stromlos machen die Dinger.
Der Mega Reset hilf nicht immer.


Gruß
miparo
wom
 
Avatar
 
Subject:

Re: Probleme mit MIRF Treiber MIRF24port

 · 
Posted: 07.03.2011 - 14:11  ·  #22
hallo miparo,

es funktioniert leider nur zum teil. als 'data' scheint es problemlos zu laufen. sobald ich aber umschalte auf 'bcast' bekomme ich am Slave nichts mehr. hier habe ich kein problem im programm finden können. bis jetzt ist das nicht so zufriedenstellend, wenn hir eine funktion vorhanden ist, bei der was nicht geht, und ich nicht weis warum.

Code
program WLAN01_M;

{$NOSHADOW}
{ $WG}                     {global Warnings off}

Device = mega32, VCC=5;
Define_Fuses
  Override_Fuses;
  COMport   = USB;
  FuseBits0 = [];
  FuseBits1 = [SPIEN];
  FuseBits2 = [];
  ProgMode  = SPI;

Import SysTick;
Import MIRF24port;

From System Import LongWord, LongInt, Float;


Define
  ProcClock      = 16000000;       {Hertz}
  SysTick        = 10;             {msec}
  StackSize      = $0064, iData;
  FrameSize      = $0064, iData;

                                // SCK, MOSI, MISO, SS, CE, IRQ
  MIRF24port     = SPI_Soft, PortC, 2,   3,    4,    1,  0,  5;

uses uMIRF24;

Implementation

{$IDATA}

{--------------------------------------------------------------}
{ Type Declarations }

{--------------------------------------------------------------}
{ Const Declarations }

{--------------------------------------------------------------}
{ Var Declarations }
Var
   Poll [@PortB,0]     :Bit;
   txBuff             : array[0..31] of byte;
   txString[@txBuff]  : string[30];
   rxBuff             : array[0..31] of byte;
   rxString[@rxBuff]  : string[30];
   rxCnt              : byte;
   X              : byte;

{--------------------------------------------------------------}
{ functions }

Procedure PollLED(mS:Word);
Begin
     Poll:=False;
     mDelay(mS);
     Poll:=True;
     mDelay(25);
End;

Procedure InitSystem;
Begin
     DDRB    := DDRB Or %00000001;      // Output=1  Input=0
     Poll:=True;
     EnableInts;

     mrfSetChan(mrfChan4, false);
     mrfSetPower(mrfdBm0);
     mrfSetLocalAddr(1);
     mrfSetRetryMax(10);
     mrfSetRetryTimeOut(3);                          // 5x 250usec -> 1.25msec
     mrfSetRFspeed(mrfRF2000);
End;
{--------------------------------------------------------------}
{ Main Program }
{$IDATA}

begin
     InitSystem;
     EnableInts;
     Loop
       if mrfInit then
         PollLED(25);
         loop
           txString:= '12345';
           Repeat
           Until mrfTxPacket(20, @txBuff,5, false);
           PollLED(25);
           mDelay(500);
         endloop;
       endif;
       mDelay(500);
     EndLoop;
end.


Code
program WLAN01_S;

{$NOSHADOW}
{ $WG}                     {global Warnings off}

Device = mega32, VCC=5;
Define_Fuses
  Override_Fuses;
  COMport   = USB;
  FuseBits0 = [];
  FuseBits1 = [SPIEN];
  FuseBits2 = [];
  ProgMode  = SPI;

Import SysTick;
Import MIRF24port;

From System Import LongWord, LongInt, Float;


Define
  ProcClock      = 16000000;       {Hertz}
  SysTick        = 10;             {msec}
  StackSize      = $0064, iData;
  FrameSize      = $0064, iData;

                                // SCK, MOSI, MISO, SS, CE, IRQ
  MIRF24port     = SPI_Soft, PortC, 2,   3,    4,    1,  0,  5;

uses uMIRF24;

Implementation

{$IDATA}

{--------------------------------------------------------------}
{ Type Declarations }

{--------------------------------------------------------------}
{ Const Declarations }

{--------------------------------------------------------------}
{ Var Declarations }
Var
   Poll [@PortB,0]     :Bit;
   txBuff             : array[0..31] of byte;
   txString[@txBuff]  : string[30];
   rxBuff             : array[0..31] of byte;
   rxString[@rxBuff]  : string[30];
   rxCnt              : byte;
   X              : byte;

{--------------------------------------------------------------}
{ functions }

Procedure PollLED(mS:Word);
Begin
     Poll:=False;
     mDelay(mS);
     Poll:=True;
     mDelay(25);
End;

Procedure InitSystem;
Begin
     DDRB    := DDRB Or %00000001;      // Output=1  Input=0
     Poll:=True;
     EnableInts;

     mrfSetChan(mrfChan4, false);
     mrfSetPower(mrfdBm0);
     mrfSetLocalAddr(20);
     mrfSetRetryMax(10);
     mrfSetRetryTimeOut(3);                          // 5x 250usec -> 1.25msec
     mrfSetRFspeed(mrfRF2000);
End;



{--------------------------------------------------------------}
{ Main Program }
{$IDATA}

begin
     EnableInts;
     InitSystem;
     loop
       PollLED(25);
       if mrfInit then
         loop
           repeat
           until (mrfGetRxType <> mrfPKTnone) Or (x<=0);
           
           case mrfRxPacket(@rxBuff, 100, rxCnt) of
             mrfPKTbcast : PollLED(25);PollLED(25);|
             mrfPKTdata  : If rxCnt=5 Then
                             If rxBuff[2]=Ord('2') Then
                               PollLED(15);
                             EndIf;
                           EndIf;        |
           EndCase;
         endloop;
       endif;
     endloop;
end.
 
miparo
Administrator
Avatar
Gender:
Location: Germany
Age: 59
Posts: 957
Registered: 09 / 2007
Subject:

Re: Probleme mit MIRF Treiber MIRF24port

 · 
Posted: 07.03.2011 - 17:57  ·  #23
Hi wom,
was hast Du den für eine Compier Version ?
Dieser bcast Fehler war in der ersten MIRF24 Unit wenn es daran liegt.
Teste mal die letzte aus dem Anhang.

Gruß
miparo
wom
 
Avatar
 
Subject:

Re: Probleme mit MIRF Treiber MIRF24port

 · 
Posted: 07.03.2011 - 19:40  ·  #24
hallo miparo,

ich verwende die version 4.99.32.

komme aber erst früherstens am mittwoch zum testen.

gruss
wom
  • 1
  • 2
  • 3
  • 4
  • Page 3 of 4
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 10 · Cache Hits: 13   135   148 · Page-Gen-Time: 0.018838s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI