change event time from second to millisecond for stmf103rbt6

Discussion in 'Embedded Systems and Microcontrollers' started by asif45, Nov 12, 2015.

  1. asif45

    Thread Starter New Member

    Nov 12, 2015
    15
    0
    Hi

    I am doing a project in keil uvision. i got the whole project ready. but i need to change event time from second to millisecond . i am new to microcontroller programming. If any1 can help me with this i will really appreciate. there is two files i copied below system.c and task.c.
     
    Last edited: Mar 22, 2016
  2. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,789
    Two things:
    1. Enclose the text of the two files in code /code tags so indenting will take place. It is hard enough to read unfamiliar code, and harder still when it is not indented.
    2. Realize that changing the time to 1 msec may not work at all depending on how the code is put together.
    I'm guessing you did not write this code originally. Do you have any helpful documentation for it or a link to where it came from?

    Oh great - I just noticed the comments are not in English. Guess I won't be much help to you.
     
    asif45 likes this.
  3. asif45

    Thread Starter New Member

    Nov 12, 2015
    15
    0
    Hi

    I just need to send event from microcontroller stm32fb103rbt6 to usb in millisecond. I changed few things and compliled n keil . DIdn't show any error but i am really new at this. Comments are in portuguese but i think its not difficult to understand. I will really apppreciate any help on this.
     
    Last edited: Mar 23, 2016
  4. AlphaOmega

    New Member

    Apr 30, 2012
    4
    1
    I don't really understand your question, but a quick scan of the code indicates that there are specific timings in the range of mS, these are clearly important! if internal delays are of a greater scale than your overall time requirements, then you are stuck! it looks like you are trying to get a quart into a pint pot.

    Maybe you need first to understand the timing requirements of the code? The above method may not be suitable for your needs?
     
    asif45 likes this.
  5. asif45

    Thread Starter New Member

    Nov 12, 2015
    15
    0
    Hi


    I am trying to send a signal( Timestamp) from stm32f103rbt6 microcontroller through a usb to output terminal. The output will check the event (Struct output data ) occured in millisecond.

    at the moment its checking in seconds.

    It has nothing to do with delay i think.
     
  6. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,789
    What we are saying is that the code and the USB port may not be fast enough to support the transmission of an event every millisecond.
     
    asif45 likes this.
  7. asif45

    Thread Starter New Member

    Nov 12, 2015
    15
    0
    thanks for the reply . Do i need to change u32Prescaler, u32UsbTimer to u64Prescaler, u32usbTimer. At beginning i thought i can easily change from second to millisecond but now looks like too much complicated. Little bit lost here about how to approach this problem.
     
  8. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,789
    I don't know your processor well enough to answer your question. I do want to know what speed your USB is running at. If it is Low Speed (1.5 MBPS) there is no chance. If it is Full Speed (12 MBPS) there is a slim chance, but you will be flooding the USB channel with events. If it is High Speed (480 MBPS) chances are better.
     
  9. asif45

    Thread Starter New Member

    Nov 12, 2015
    15
    0
    i am using usb 2.
     
  10. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,789
    With in USB 2.0 there are THREE possible data transmission speeds which I have detailed in two previous posts. Which one are you planning to use?
     
  11. asif45

    Thread Starter New Member

    Nov 12, 2015
    15
    0
    It's 12 MBPS. If i can modify the program then i can run n test . Can you please tell me which part of the program i need to change for millisecond.
     
  12. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,789
    No, I'm not there yet. It is really slow going. A datarate of 12 MPBS is called Full Speed. How much data is in one of your event packets?
     
  13. asif45

    Thread Starter New Member

    Nov 12, 2015
    15
    0
    Can someone please tell me how can i change "u32Time" from that code in top. it is currently sending timestamp in second..i need to change it from second to millisecond. thanks
     
Loading...