change event time from second to millisecond for stmf103rbt6

Thread Starter

asif45

Joined Nov 12, 2015
15
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:

Papabravo

Joined Feb 24, 2006
12,405
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.
 

Thread Starter

asif45

Joined Nov 12, 2015
15
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:

AlphaOmega

Joined Apr 30, 2012
5
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?
 

Thread Starter

asif45

Joined Nov 12, 2015
15
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.
 

Attachments

Papabravo

Joined Feb 24, 2006
12,405
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.
 

Thread Starter

asif45

Joined Nov 12, 2015
15
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.
 

Papabravo

Joined Feb 24, 2006
12,405
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.
 

Papabravo

Joined Feb 24, 2006
12,405
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?
 

Thread Starter

asif45

Joined Nov 12, 2015
15
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.
 

Papabravo

Joined Feb 24, 2006
12,405
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?
 

Thread Starter

asif45

Joined Nov 12, 2015
15
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
 
Top