Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - tr111

Pages: 1 2 [3] 4 5
31
NXPTM M522XX, KINETIS and i.MX RT / also the 52235evb'CAN send data!
« on: November 22, 2007, 09:11:56 AM »
static void fnConfigCAN_BUS(void)
{
CANTABLE tCANParameters; // table for passing information to driver
tCANParameters.Task_to_wake = OWN_TASK; // wake us on buffer events
tCANParameters.Channel = 0;        // first hardware interface       
 tCANParameters.ulSpeed = 100000;    // 100K speed
tCANParameters.ulTxID = 0x80;       // default ID of destination                           
tCANParameters.ulRxID = (CAN_EXTENDED_ID | 0x00000105);  // our ID                           
tCANParameters.ulRxIDMask = CAN_EXTENDED_MASK;
                                // use all bits for compare
tCANParameters.usMode = 0x01;      // use lpb mode
tCANParameters.ucTxBuffers = 2; // assign two tx buffers for use
tCANParameters.ucRxBuffers = 3; // assign three rx buffers for use

CAN_interface_ID = fnOpen( TYPE_CAN, FOR_I_O, &tCANParameters );


 }


static void fnSENDCAN_BUS(void)
{

unsigned char ucTestMessage[] = {1,2,3,4,5,6,7};  // Test message
if (fnWrite(CAN_interface_ID, ucTestMessage, sizeof(ucTestMessage))
                                 != sizeof(ucTestMessage)) {
    // Error. Eg. no transmission buffer free
fnDebugMsg("\n\r SENT ERROR\n\r");

}

tCANParameters.usMode = 0x01;      // use lpb mode
this is  the CAN_LOOPBACK,and the  fnWrite(CAN_interface_ID, ucTestMessage, sizeof(ucTestMessage)) is OK!
but I can't get anything from the CAN-BUS using the OSCILLOSCOPE!

what about the tCANParameters.Channel = 0;        // first hardware interface       
the 52235 have more CANTX and CANRX ,now we are use the PASPAR |= 0xa0;                                                      // configure AS port 2,3 as CAN

I don't sure the  set #define NUMBER_CAN 3,now WE are use the #define NUMBER_CAN 2.

how can I get the data?????? I don't know!

32
NXPTM M522XX, KINETIS and i.MX RT / Re: WHY the M52235EVB can't sent data!
« on: November 16, 2007, 04:15:21 PM »
thank you?I will try?

33
NXPTM M522XX, KINETIS and i.MX RT / WHY the M52235EVB can't sent data!
« on: November 16, 2007, 07:37:52 AM »
#define CAN_INTERFACE 

 case 100000:                                                    //100KHz
        CANCTRL = (((10-1) << 24) | RJW_2 | EXTAL_CLK_SOURCE | PROPSEG_BIT_TIME8 | PHASE_BUF_SEG1_LEN8 | PHASE_BUF_SEG2_LEN8);  // Initialise the CAN controller with the required speed and parameters
        break;

QUEUE_HANDLE CAN_interface_ID = 0;
static void fnConfigCAN_BUS(void)
{
CANTABLE tCANParameters; // table for passing information to driver
tCANParameters.Task_to_wake = OWN_TASK; // wake us on buffer events
tCANParameters.Channel = 0;        // first hardware interface       
 tCANParameters.ulSpeed = 100000;    // 100K speed
tCANParameters.ulTxID = 0x80;       // default ID of destination                           
tCANParameters.ulRxID = (CAN_EXTENDED_ID | 0x00000105);  // our ID                           
tCANParameters.ulRxIDMask = CAN_EXTENDED_MASK;
                                // use all bits for compare
tCANParameters.usMode = 0;      // use normal mode
tCANParameters.ucTxBuffers = 2; // assign two tx buffers for use
tCANParameters.ucRxBuffers = 3; // assign three rx buffers for use

CAN_interface_ID = fnOpen( TYPE_CAN, FOR_I_O, &tCANParameters );


 }
CAN_interface_ID is OK,and CAN_interface_ID =0x09!

static void fnSENDCAN_BUS(void)
{

unsigned char ucTestMessage[] = {1,2,3,4,5,6,7};  // Test message
if (fnWrite(CAN_interface_ID, ucTestMessage, sizeof(ucTestMessage))
                                 != sizeof(ucTestMessage)) {
    // Error. Eg. no transmission buffer free
fnDebugMsg("\n\r SENT ERROR\n\r");
}
}

but the fnSENDCAN_BUS always "SENT ERROR"!why???????


34
     Thanks you!
     I do that a day!I can sure that now!
   

35
case 1000000:

CANCTRL = ((3 << 24) | RJW_2 | EXTAL_CLK_SOURCE | PROPSEG_BIT_TIME2 | PHASE_BUF_SEG1_LEN3 | PHASE_BUF_SEG2_LEN2);

PRESDIV=3;
RJW_2=2,
EXTAL_CLK_SOURCE =0;
PROPSEG_BIT_TIME2   (1)       =1;
PHASE_BUF_SEG1_LEN3 (2<<19)           =2;
 PHASE_BUF_SEG2_LEN2 (1<<16)   =1;
because the EXTAL_CLK=25000000;
so  Ftq = 25000000/(3+1);
Sync_Seg + Prop_Seg +Phase_Seg1 + Phase_Seg2=1+(1+1)+(2+1)+(1+1)=8
BIT RATE= Ftq /(1+1+1+2+1+1+1)!=1000000;???????ERROR????????

BUT THE
default:                                                             // 40 KHz
        CANCTRL = ((24 << 24) | RJW_2 | EXTAL_CLK_SOURCE | PROPSEG_BIT_TIME8 | PHASE_BUF_SEG1_LEN8 | PHASE_BUF_SEG2_LEN8); // Initialise the CAN controller with the required speed and parameters// Initialise the CAN controller with the required speed and parameters
PRESDIV=24;
so  Ftq = 25000000/(24+1);
Sync_Seg + Prop_Seg +Phase_Seg1 + Phase_Seg2=1+(7+1)+(7+1)+(7+1)=25
BIT RATE= Ftq /(25)=40000=40kHZ!

WHY???????make sure????which is RIGHT????????






       

36
I can't understand that :
 switch (pars->ulSpeed) {                                             // M5223X EVB
    case 1000000:
        CANCTRL = ((3 << 24) | RJW_2 | EXTAL_CLK_SOURCE | PROPSEG_BIT_TIME2 | PHASE_BUF_SEG1_LEN3 | PHASE_BUF_SEG2_LEN2); // Initialise the CAN controller with the required speed and parameters
        break;

    default:                                                             // 40 KHz
        CANCTRL = ((24 << 24) | RJW_2 | EXTAL_CLK_SOURCE | PROPSEG_BIT_TIME8 | PHASE_BUF_SEG1_LEN8 | PHASE_BUF_SEG2_LEN8); // Initialise the CAN controller with the required speed and parameters
        break;

    }
BUT I want to get the 100 khz,how can I get???


37
I find why!
  add the can_drv.c to the project!
  add static to the QUEUE_TRANSFER entry_can
 static  QUEUE_TRANSFER entry_can(unsigned char channel, unsigned char *ptBuffer, QUEUE_TRANSFER Counter, unsigned char ucCallType, QUEUE_HANDLE DriverID)!

38
NXPTM M522XX, KINETIS and i.MX RT / something error #define CAN_INTERFACE!
« on: November 14, 2007, 08:42:42 AM »
if #define CAN_INTERFACE!
use the CodeWarrior IDE!

Warning : function has no prototype
M5223X.c line 3125   extern fnDumpCAN(void) 

Link Error   : Undefined : "fnOpenCAN"
Referenced from "fnOpen" in Driver.c

Link failed.

39
µTasker general / Re: how to set the MAC address!
« on: November 08, 2007, 06:47:31 AM »
I have known why,because #undefine  FLASH_FILE_SYSTEM ,so I do it now!

But now I have a question? I use the mcf52235evb!

when I do " MAC 00-A0-1E-52-00-00" .the MAC address = 00-a0-1e-52-00-00,
But I search the FLASH ,I didn't find the MAC address  locate at flash???
why???
BUT when I do "set_ip_add 192.168.0.15" and "save",I will find the Ip and the MAC address
locate at flash somewhere!WHY????
5555FFFF FFFF0018 00A01E52 5300C0A8
000FFFFF FF00C0A8 0002C0A8 00010500
00782020 00175D07 00000000 41444D49
4E262020 75546173 6B657226 75546173

40
µTasker general / how to set the MAC address!
« on: November 08, 2007, 04:39:18 AM »
Main menu
===================
1              Configure LAN interface
2              Configure serial interface
3              Go to I/O menu
4              Go to administration menu
5              Go to overview/statistics menu
help           Display menu specific help
quit           Leave command mode

I know to the  1              Configure LAN interface
can set the MAC!
But I use the MAC 00-a0-1e-52-23-50,it is false!
I do it success long ago! I have format the flash,That is said  the first time to set mac!
can I use the "MAC" wrong!


41
µTasker general / Re: #define SPI_FILE_SYSTEM compile ERROR!
« on: September 21, 2007, 02:58:53 PM »
thank you!

42
µTasker general / Re: #define SPI_FILE_SYSTEM compile ERROR!
« on: September 21, 2007, 08:14:02 AM »
thank you! Every one do is for the uTasker to be perfection!
That is ok!
Can that the ATMEL AT45DBXXX   use the fnEraseFlashSector();   fnWriteBytesFlash(); fnGetParsFile() to save or read data after defined SPI_FILE_SYSTEM !

43
µTasker general / #define SPI_FILE_SYSTEM compile ERROR!
« on: September 21, 2007, 02:45:18 AM »
Hello:
       I have  defined SPI_FILE_SYSTEM and undefined FLASH_FILE_SYSTEM!
       I want to use the fnEraseFlashSector();   fnWriteBytesFlash(); fnGetParsFile() at the ATMEL AT45DBXXX ,
       I don't want to use the SPI_SW_UPLOAD,it is too complex.No like the vxworks's bootrom,that is easy to use.
       Can that the ATMEL AT45DBXXX   only use to SPI_SW_UPLOAD no the fnEraseFlashSector();   fnWriteBytesFlash(); fnGetParsFile() ??
      Otherwise if I have the M95XXX EEPROM  ,but defined SPI_FILE_SYSTEM  it will be ERROR!
      why!

       but compil ERROR! look this:
       Error   : unexpected end of line
M5223X.c line 2112                      // uses external file system in M95XXX EEPROM 

Error   : illegal token for integral constant expression
M5223X.c line 2114       extern QUEUE_HANDLE SPI_handle; 

Error   : undefined identifier 'M95XXX_WRITE_ENABLE'
M5223X.c line 2176       static const unsigned char ucWriteEnable[] = {M95XXX_WRITE_ENABLE, TERMINATE_WRITE}; // enable write 

Error   : function has no prototype
M5223X.c line 2184           fnWaitWriteComplete();                                           // wait until free to write 

Error   : undefined identifier 'SPI_handle'
M5223X.c line 2186           fnWrite(SPI_handle, (unsigned char *)ucWriteEnable, sizeof(ucWriteEnable)); // prepare write 

Error   : function has no prototype
M5223X.c line 2187           fnWriteBytesEEPROM(ptrEEPROM, ucDel, EEPROM_PAGE_SIZE);          // delete a page 

Error   : undefined identifier 'M95XXX_WRITE_ENABLE'
M5223X.c line 2253       static const unsigned char ucWriteEnable[] = {M95XXX_WRITE_ENABLE, TERMINATE_WRITE}; // enable write 

Error   : undefined identifier 'SPI_handle'
M5223X.c line 2263           fnWrite(SPI_handle, (unsigned char *)ucWriteEnable, sizeof(ucWriteEnable)); // prepare write 

Error   : ';' expected
M5223X.c line 2464   extern SPIQue *spi_rx_control; 

Error   : undefined identifier 'M95XXX_READ_MEMORY'
M5223X.c line 2669       usRead[0] = M95XXX_READ_MEMORY; 

Error   : undefined identifier 'SPI_handle'
M5223X.c line 2675       fnWrite(SPI_handle, usRead, sizeof(usRead));                         // set the read address 

Error   : undefined identifier 'SPI_handle'
M5223X.c line 2676       fnRead(SPI_handle, ptrValue, usSize);                                // read from the device to the return buffer 


44
thank you!

45
HELLO:
  when I #define SPI_SW_UPLOAD and undef FLASH_FILE_SYSTEM,
it is ERROR!
Error   : undefined identifier 'uFILE_START'
M5223X.c line 2089       ptrSector -= (uFILE_START + FILE_SYSTEM_SIZE);                       // location relative to the start of the SPI FLASH chi

Error   : undefined identifier 'uFILE_START'
M5223X.c line 2683       if ((ParLocation >= ((unsigned char *)(uFILE_START + FILE_SYSTEM_SIZE))) && (ParLocation < ((unsigned char *)(uFILE_START +

Error   : undefined identifier 'uFILE_START'
M5223X.c line 2716       fnGetParsFile((unsigned char*)(uFILE_START), (unsigned char *)ucValidUse, sizeof(ucValidUse)); 

Error   : undefined identifier 'uFILE_START'
M5223X.c line 2730           fnGetParsFile((unsigned char*)(uFILE_START), (unsigned char *)ucValidUse, sizeof(ucValidUse)); 


Pages: 1 2 [3] 4 5