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
46
µTasker general / also about the AT45DB161D SPI_EEPROM use!
« on: September 20, 2007, 04:28:40 AM »
HELLO:
        In the app_hw_m5223x.h
        #define SPI_FLASH_PAGE_LENGTH 264                                        // standard page size (B-device only allows 256)
//#define SPI_FLASH_PAGE_LENGTH 256                                      // size when power of 2 mode selected (only possible on D-device)
#define SPI_FLASH_BLOCK_LENGTH (8*SPI_FLASH_PAGE_LENGTH)                 // block size - a block can be deleted
#define SPI_FLASH_SECTOR_LENGTH (64*4*SPI_FLASH_PAGE_LENGTH)             // exception sector 0a is 2k and sector 0b is 62k
#define SPI_FLASH_PAGES         1024                                     // 256k part expected
#define SPI_DATA_FLASH_SIZE    (SPI_FLASH_PAGES*SPI_FLASH_PAGE_LENGTH)

I think this is satisfy to AT45DB021:
• Page Program Operation
– Single Cycle Reprogram (Erase and Program)
– 1024 Pages (264 Bytes/Page) Main Memory

if I use the AT45DB161D must be like this
#define SPI_FLASH_PAGE_LENGTH 512                                       // standard page size (B-device only allows 256)
//#define SPI_FLASH_PAGE_LENGTH 256                                      // size when power of 2 mode selected (only possible on D-device)
#define SPI_FLASH_BLOCK_LENGTH (8*SPI_FLASH_PAGE_LENGTH)                 // block size - a block can be deleted
#define SPI_FLASH_SECTOR_LENGTH (64*4*SPI_FLASH_PAGE_LENGTH)             // exception sector 0a is 2k and sector 0b is 62k
#define SPI_FLASH_PAGES         4,096                                     // 256k part expected
#define SPI_DATA_FLASH_SIZE    (SPI_FLASH_PAGES*SPI_FLASH_PAGE_LENGTH)

AT45DB161D:
• User Configurable Page Size
– 512 Bytes per Page
– 528 Bytes per Page
• Page Program Operation
– Intelligent Programming Operation
– 4,096 Pages (512/528 Bytes/Page) Main Memory
• Flexible Erase Options
– Page Erase (512 Bytes)
– Block Erase (4 Kbytes)
– Sector Erase (128 Kbytes)
– Chip Erase (16 Mbits)
• Two SRAM Data Buffers (512/528 Bytes)

47
µTasker general / Re: about the AT45DB161D SPI_EEPROM use!
« on: September 19, 2007, 05:18:32 PM »
Mark:
      you must be a doctor!So professional!

48
µTasker general / Re: about the AT45DB161D SPI_EEPROM use!
« on: September 19, 2007, 04:33:18 PM »
Mark:
     that uOpenFile(), uGetFileLength(), uGetFileData() can't use to the M95128, M95256, M95512  too ??
    to use theM95128, M95256, M95512 must to use the
     fnEraseFlashSector();fnWriteBytesFlash();fnGetParsFile()?????????

49
µTasker general / Re: about the AT45DB161D SPI_EEPROM use!
« on: September 19, 2007, 04:10:23 PM »
MarK:
     that your mean is:M95128, M95256, M95512 can use as uFileSystem when define SPI_FILE_SYSTEM!
     The ATMEL AT45DBXXX can only use as SPI_SW_UPLOAD,but in the future it will use as the uFileSystem ????
     I will waiting  for this!
     I think the uTasker is well!

50
µTasker general / about the AT45DB161D SPI_EEPROM use!
« on: September 19, 2007, 07:46:47 AM »
Hello:
     I have the AT45DB161D chip,but the config.h only" chip size EEPROM_16K, EEPROM_32K or EEPROM_64K". this too small,the AT45DB161D  is 16-megabit. How can I use the chip size????
     In the uTasker SPI_EEPROM.doc "The necessary circuit for the SPI EEPROM is shown in appendix A. It is shown for connecting to a number of Freescale evaluation/demo boards."
     Can AT45DB161D  also use the The necessary circuit like you do????????

51
µTasker general / Re: about the FLASH_FILE_SYSTEM USE!
« on: September 17, 2007, 12:37:25 PM »
thank you!

52
µTasker general / about the FLASH_FILE_SYSTEM USE!
« on: September 17, 2007, 09:01:56 AM »
hello:
     I have #define FLASH_FILE_SYSTEM,but I don't know how to write data to the FLASH!
     look like I have a file  asc16.bin ,how can I write asc16.bin  to the FLASH!
     I find the #ifdef _WINDOWS at the  fnWriteLongWordFlash(); what the #ifdef _WINDOWS 's function!
     In the vxworks' tffs file system I can send FILE to the flash by ftp client and I can use the FILE by use the FOPEN(); Now I have  #define USE_FTP,
and do this: ftp://ADMIN:uTasker@192.168.0.3  ,but I can't  send file to the flash in Utasker ,how can I use the file!
    WHY!??

53
µTasker general / Re: How to use the IIC to get data and send data!
« on: September 12, 2007, 10:39:35 AM »
Mark :
     Your answer iis always fast! Thank you!

54
µTasker general / How to use the IIC to get data and send data!
« on: September 12, 2007, 10:02:57 AM »
  I have #define IIC_INTERFACE,but  I don't how to use the IIC to get data and send data!
  In old use I use IIC as  master , look like this "UINT8 i2c_write(UINT8 slave_address, UINT8 *buffer, int byte_count)" and "UINT8 i2c_read(UINT8 slave_address, UINT8 *buffer, int byte_count)" !
  But how can use in the Utasker! I find the "extern void fnTxIIC(IICQue *ptIICQue, int iChannel)" and the "static __interrupt__ void _IIC_Interrupt(void)"!
   Can use this???
   I don't understand the "static QUEUE_TRANSFER entry_IIC(QUEUE_HANDLE channel, unsigned char *ptBuffer, QUEUE_TRANSFER Counter, unsigned char ucCallType, QUEUE_HANDLE DriverID)"!
   How to use???

55
µTasker general / Re: How to use the timer in the uart get data!
« on: September 10, 2007, 04:40:15 PM »
MARK:
      Thank you!

56
µTasker general / How to use the timer in the uart get data!
« on: September 10, 2007, 10:54:39 AM »
HELLO:
4. In some cases (example when transferring random binary data from the serial port to somewhere else - like TCP) there is no framing possibilities. In this case each received character can be sent on but it can result in lots of short frames. A technique often used is to collect the received data in a buffer and send a packet once a certain length has been received (this optimises the frame lengths so that larger frames are sent rather than lots of short ones when there is a lot of data). However if there are only a few sporadish bytes of received data this causes a proble since they will only be sent when enough has been collected (very long pauses). To correct this a timer is used as well as the buffer. If no received data has been received for a certain amount of time (say 100ms) the buffer will also be sent, no matter how many bytes have been collected.
Working with a buffer length and a timeout it is possible to set these as parameters to acheive efficient throughput/frame size for a certain application - thsi mode of operation (including these set up parameters) is typical for RS232 <-> LAN converter operation.

look like this in the char mode :
       while  (fnMsgs(SerialPortID)) {
             Length =   fnRead( SerialPortID, ucInputMessage, BIG_MESSAGE);
                get_buff[ii]=*ucInputMessage;
                //printfk(get_buff[ii]);
               // printfk(ii);
             
                ii++;
               buff_len=ii;
               // timeout=1;
               //printfk(i);
            //  fnEchoInput(ucInputMessage, Length);
              }

     this will be right only the first time ,the second frames arrived will be wrong.Because  I don't to set ii=0 at right time to get the next frames !
    When get data I don't how to use timer to " no received data has been received for a certain amount of time "! How to get the end of the frames!
    In the Dynamic C 8.01 for rabbit it is use this to get data:
       memset(serBuffer,0,sizeof(serBuffer));
       rec_len=serBread( serBuffer, sizeof(serBuffer),SERL_REC_TIME);
       if (rec_len<=0) return;
     the rec_len is the all the frames 's number.then I can use the serBuffer to do what i want!
      if I send the 0x01 0x02 0x03 0x04 ,the rec_len will be 4.
     

57
µTasker general / Re: also the uart use!
« on: September 09, 2007, 01:05:43 AM »
Mark :
       You are right!Thank you!

58
µTasker general / also the uart use!
« on: September 08, 2007, 12:38:15 PM »
Mark:
2. Fixed message lengths.
If the received messages have random content but fixed length, they can be collected until a complete message is available. In character mode, the following could be used (called each time the task is worken by a character reception).
while (fnMsgs(SerialPortID) >= MESSAGE_LENGTH) {
    unsigned char ucBuff[MESSAGE_LENGTH];
    fnRead(SerialPortID, ucBuff, MESSAGE_LENGTH);         // read a complete message which is waiting
    fnWrite(SerialPortID, ucBuff, MESSAGE_LENGTH);        // send complete message back
}
I like to use the 2 Fixed message lengths.
but where to add the
    while (fnMsgs(SerialPortID) >= MESSAGE_LENGTH) {
    unsigned char ucBuff[MESSAGE_LENGTH];
    fnRead(SerialPortID, ucBuff, MESSAGE_LENGTH);         // read a complete message which is waiting
    fnWrite(SerialPortID, ucBuff, MESSAGE_LENGTH);        // send complete message back
}
 is in the  application.c ???
 
  #ifdef SERIAL_INTERFACE
      #ifdef TEST_MSG_MODE
          #ifdef TEST_MSG_CNT_MODE/*step 1*/
            while (fnMsgs(SerialPortID)) {
                unsigned char ucLength;

                fnRead( SerialPortID, &ucLength, 1);                     // get message length
                Length = fnRead( SerialPortID, ucInputMessage, ucLength);
                fnEchoInput(ucInputMessage, ucLength);
            }
          #else/*step 2*/
            while (fnMsgs(SerialPortID)) {
                Length = fnRead( SerialPortID, ucInputMessage, MEDIUM_MESSAGE);
                fnEchoInput(ucInputMessage, Length);
            }
          #endif
      #else/*step 3*/
        if ((iAppState & (STATE_ACTIVE | STATE_DELAYING | STATE_ESCAPING | STATE_RESTARTING | STATE_VALIDATING)) && (Length = fnMsgs(SerialPortID))) {
            while ((Length = fnRead( SerialPortID, ucInputMessage, MEDIUM_MESSAGE)) != 0) {
                fnEchoInput(ucInputMessage, Length);
                if (usData_state == ES_NO_CONNECTION) {
                    if (fnCommandInput(ucInputMessage, Length, SOURCE_SERIAL)) {
                        if (fnInitiateLogin(ES_SERIAL_LOGIN) == TELNET_ON_LINE) {
                            static const CHAR ucCOMMAND_MODE_BLOCKED[] = "Command line blocked\r\n";
                            fnWrite(SerialPortID, (unsigned char *)ucCOMMAND_MODE_BLOCKED, sizeof(ucCOMMAND_MODE_BLOCKED));
                        }
                    }
                }
                else {
                    fnCommandInput(ucInputMessage, Length, SOURCE_SERIAL);
                }
            }
        }
      #endif
  #endif
  I find it always go the /*step 3*/, But I don't sure the /*step 3*/  function,it look like the TELNET function!
  I don't like to change the TELNET function! How can I do???
  can add the"2. Fixed message lengths" in fnEchoInput(ucInputMessage, Length);?????
  Regards
  tr111

59
µTasker general / Also about the uart get data!
« on: September 08, 2007, 10:40:45 AM »
 When I send the data to the uart.data=(0x11,0x22,0x33,0x44,0x55)
       like this:
       #else
        if ((iAppState & (STATE_ACTIVE | STATE_DELAYING | STATE_ESCAPING | STATE_RESTARTING | STATE_VALIDATING)) && (Length = fnMsgs(SerialPortID))) {
            while ((Length = fnRead( SerialPortID, ucInputMessage, MEDIUM_MESSAGE)) != 0) {
                fnEchoInput(ucInputMessage, Length);
                fnDebugMsg("\n\rLED ON OFF\n\r");
                if (usData_state == ES_NO_CONNECTION) {
                    if (fnCommandInput(ucInputMessage, Length, SOURCE_SERIAL)) {
                        if (fnInitiateLogin(ES_SERIAL_LOGIN) == TELNET_ON_LINE) {
                            static const CHAR ucCOMMAND_MODE_BLOCKED[] = "Command line blocked\r\n";
                            fnWrite(SerialPortID, (unsigned char *)ucCOMMAND_MODE_BLOCKED, sizeof(ucCOMMAND_MODE_BLOCKED));
                        }
                    }
                }
       I find the Length always 1,and printf the "LED ON OFF" five times! Why!
       I want the get the data(0x11,0x22,0x33,0x44,0x55) is a long buff,not the CHAR_MODE one by one!
       I want the Length is 5 not 1,so that I can easy to use the buff.not like the char!
       

     When I #define TEST_MSG_MODE,but it never go to the
     #ifdef TEST_MSG_MODE
          #ifdef TEST_MSG_CNT_MODE
            while (fnMsgs(SerialPortID)) {
                unsigned char ucLength;

                fnRead( SerialPortID, &ucLength, 1);                     // get message length
                Length = fnRead( SerialPortID, ucInputMessage, ucLength);
              fnDebugMsg("\n\rLED ON 1OFF\n\r");
                fnEchoInput(ucInputMessage, ucLength);
            }
          #else
            while (fnMsgs(SerialPortID)) {
                Length = fnRead( SerialPortID, ucInputMessage, MEDIUM_MESSAGE);
                 fnDebugMsg("\n\rLED2 ON OFF\n\r");
                fnEchoInput(ucInputMessage, Length);
            }
          #endif
fnMsgs(SerialPortID); This is called to return the number of waiting messages. In character mode this is equal to the number of characters but in message mode it will indicate the number of complete messages and not individual characters.
   how can I get the "in message mode",I want to get complete messages and not individual characters!


60
µTasker general / Re: How to use the UART to get data and send data!
« on: September 08, 2007, 01:28:30 AM »
Mark:
     Thank you very much!
     Your answer is always fast and professional!
      Regards

     tr111


Pages: 1 2 3 [4] 5