Re: Timer() loses time

Started by Frank Manning in BasicX16 years ago

From: Neil Jepsen <> > [...]as soon as I realised that timer was not losing > time, my "game_time" was incorrect.. I've repeated ...

From: Neil Jepsen <> > [...]as soon as I realised that timer was not losing > time, my "game_time" was incorrect.. I've repeated > the offending code below, and the fix. [...] > > if (timer>=p) then > p = timer + 1.0 >


PWM & Timer

Started by soso soso in BasicX14 years ago 2 replies

Hi~ I have a question about timer. In my applicaiton, PWM is always used to control a DC motor, but I also want to use the command...

Hi~ I have a question about timer. In my applicaiton, PWM is always used to control a DC motor, but I also want to use the command "timer" to calcuate the time interval of a function. for example: main() CallTask "PWM_Task", PWM_STACK 'a PWM task that always run do A = timer call function() 'just a example function B = t


Run time timer

Started by nuepatrick in BasicX14 years ago 2 replies

I have a project that I am designing and I need a simple accurate timer that starts when power is applied to the circuit. I need to display...

I have a project that I am designing and I need a simple accurate timer that starts when power is applied to the circuit. I need to display this on a bpi-216. Any ideas would be appericated. Thanks Patrick


Re: RTC

Started by Art Church in BasicX15 years ago

Thanks. Made those changes. Based on your comments I am now looking at where I use timer and perhaps could use RTCtick instead as I...

Thanks. Made those changes. Based on your comments I am now looking at where I use timer and perhaps could use RTCtick instead as I basically take timer back to to a integer of milliseconds for my purposes.The same should apply there too I would think. Art -----Original Message--


Re: Timer() loses time

Started by Chris in BasicX16 years ago 8 replies

Neil, Frank is correct, I misspoke. Com3 will not interfere with the RTC. I was thinking of something else. Are you...

Neil, Frank is correct, I misspoke. Com3 will not interfere with the RTC. I was thinking of something else. Are you perhaps incrementing your Time variable with a "rounded" Timer result? Doing so would cause the loss of time you are seeing. Chris


how pass ADC contents to Timer/Counter

Started by antoniod_arienzo in BasicX12 years ago 1 reply

Hello, my new group!!! I write from Italy, so excuse my grammar mistake... I' ve already a nice question for you... How can I pass the contents...

Hello, my new group!!! I write from Italy, so excuse my grammar mistake... I' ve already a nice question for you... How can I pass the contents of ADC's registers (ADCH and ADCL in particular) to Timer/Counters' OCRs (Output Compare Registers) directly (not using RAM storage)?


Low Power Mode using timer1 interrupt On LCDX (BX-34)

Started by ssonderhoff in BasicX11 years ago

Does anyone know how this is done? I want to put the cpu into idle mode using an interrupt from the the compare function on timer 1. According to...

Does anyone know how this is done? I want to put the cpu into idle mode using an interrupt from the the compare function on timer 1. According to the Atmel documentation this should be possible and they specifically mention using the timer interrupt to wake up the processor. I can put the system to sleep having, as best as I can tell, set the appropriate registers, however the system fails to wake...


Bx-24 Remote control cars and a drag race timer

Started by hightechhousecall in BasicX12 years ago 1 reply

Hello world (sorry had to do that) The last time I used my bx24 was in 2003 I set up a program to read MPH with 2 phototransistors set 10'...

Hello world (sorry had to do that) The last time I used my bx24 was in 2003 I set up a program to read MPH with 2 phototransistors set 10' apart. worked fine we had fun, life goes on..... OK now I have been asked to make a Drag Race timer. So I have dusted off the old proto board and here we go. Standard 2 lane race 1/10th scale track is 132' long Cars are at around 60mph at the...


Extended Timer() function

Started by Tom Becker in BasicX10 years ago 1 reply

Here is an exploit of the Basic-X register.RTCTick implementation which permits using Timer(), usually limited to a 24-hour period, to measure...

Here is an exploit of the Basic-X register.RTCTick implementation which permits using Timer(), usually limited to a 24-hour period, to measure beyond 48-day periods. Basic-X keeps the time as a 512Hz tick count in a system Long, register.RTCTick. It normally resets the register.RTCTick count to zero when it detects a count representing 24 hours since boot (or midnight if the Basic-X clock is s...


High resolution timers?

Started by arhodes19044 in BasicX15 years ago 11 replies

Is there an external timer commercially available and relatively inexpensive that is easy to interface to a BX-24? I am hoping to...

Is there an external timer commercially available and relatively inexpensive that is easy to interface to a BX-24? I am hoping to find something accurate to a few seconds a year and with better granularity than 1/512 of a second. Temperature compensation would be a great thing as well. Lithium watch battery backup would be great too!


9600 hz oscillator with the bx-24?

Started by spillikinaerospace in BasicX13 years ago 4 replies

Hello can anyone tell me what's the simplest way to make a 9600 hz oscillator with the bx24? the built-in timer apparently can't do it. maybe...

Hello can anyone tell me what's the simplest way to make a 9600 hz oscillator with the bx24? the built-in timer apparently can't do it. maybe i can manipulate com3 into doing it if i set it at 19200. but does the com3 protocol include a start bit? hmmmm.... thanx anyone, louie


Question about WaitForInterrupt()

Started by Don Kinzer in BasicX16 years ago 7 replies

When a task executes WaitForInterrupt() and then the interrupt occurs, the waiting task is activated next according to the docs. ...

When a task executes WaitForInterrupt() and then the interrupt occurs, the waiting task is activated next according to the docs. I'm guessing that it is possible for that task to be superseded on the very next timer tick (which could be immediately). If this is so, it seems


handling multiple interrupt sources?

Started by arhodes19044 in BasicX15 years ago 50 replies

I have gotten the basics done on the rally computer. I would like to have the timer generate an interrupt. I COULD do this the...

I have gotten the basics done on the rally computer. I would like to have the timer generate an interrupt. I COULD do this the crude way and have the PWM generator make something that ticks at about one Hz, or a simple multiple thereof. I could route the output of that to Pin 11 and trigger an interrupt. However, I am already using Pin 1


Accumulating timer/counter.

Started by flooby4life in BasicX13 years ago 1 reply

I am prototyping a museum exhibit that has the visitor perform a task in a perceived amount of time and then press a button to see how much time...

I am prototyping a museum exhibit that has the visitor perform a task in a perceived amount of time and then press a button to see how much time it actually took. Does the BasicX have a function that would time an interval and then send that data to a display when prompted? The display will be a digital LED type. I am new to controllers and programming but will have the help of some of my...


Push and Hold Timer

Started by Don Kirby in BasicX14 years ago 11 replies

OK, I'm out of RAM, and the application just keeps getting bigger... This is going to be interesting.. As I look for ways to reduce RAM...

OK, I'm out of RAM, and the application just keeps getting bigger... This is going to be interesting.. As I look for ways to reduce RAM usage, I am open to suggestions for the following: Sub Main is running a Do Loop in which a few different things are going on. At some point during the loop, the user can push a button, which normally doesn't do anything. However, if the user presses ...


Noob needs help with timed tasks

Started by davelcohen2000 in BasicX15 years ago 2 replies

I need to execute a particular task at regular intervals, about every 100 milliseconds, or thereabouts. I have no additional inputs to ...

I need to execute a particular task at regular intervals, about every 100 milliseconds, or thereabouts. I have no additional inputs to accomodate an external timer. Other tasks will be locked when this one runs. My question: How do you execute a task on a regular interval? I did search the archives, but could not find anything appropria


conflict of timer1

Started by Ashwin Sathyanarayanan in BasicX14 years ago

Dear all, I am using a LCD display using pins 5,6,7 & 9 to display on my LCD. And i a= m Using the input capture pin to measure display the...

Dear all, I am using a LCD display using pins 5,6,7 & 9 to display on my LCD. And i a= m Using the input capture pin to measure display the freq. I was wondering = if there is a conflict of the timer 1 by any chnace in these 2 functions. B= ecause i am not able to disply the required frequency on the LCD. Cab any o= ne please hwlp me out on this front. Thanks in advace. Regards, Ashwin O...


Timer, button, Time on delay

Started by mechatronicsccc in BasicX13 years ago

Hello, I also program AB PLCs and try to experment using what I know with programing PLC in RS logic to the microcontrolers. I am working on...

Hello, I also program AB PLCs and try to experment using what I know with programing PLC in RS logic to the microcontrolers. I am working on what would be a time on delay Relay with an enable bit. Or when I press button on pin 12 pin 19 goes high output pin 20 comes on 1 second later The code is below. My Question is: Is there another way to do this or is this it???? Or a bette...


CPUSleep and Watchdog?

Started by Tom Becker in BasicX14 years ago 7 replies

A current project sleeps (CPUSleep) after a period of inactivity. After satisfying myself that the device code is stable, I added a...

A current project sleeps (CPUSleep) after a period of inactivity. After satisfying myself that the device code is stable, I added a watchdog. The watchdog naturally wakes the device up as soon as it sleeps, defeating the low power mode. There appears to be no way to disable the watchdog timer once it's started, so using the watchdog while active _and_


Long wires

Started by erikhunsaker in BasicX9 years ago 3 replies

Hello Group I am building a timer and am using long wires to connect the finish lanes to the Basicx (Max 1000' of Cat5). Nothing but problems...

Hello Group I am building a timer and am using long wires to connect the finish lanes to the Basicx (Max 1000' of Cat5). Nothing but problems so far. With short wires the system works fine. Long wires cause one lane to trigger the other lane. Does anyone know how get the Basicx to work with long wires? ------------------------------------