Searching \ for '[SX] PULSIN running at 5mhz VS 50mhz' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/ubicom/devices.htm?key=sx
Search entire site for: 'PULSIN running at 5mhz VS 50mhz'.

Exact match. Not showing close matches.
PICList Thread
'[SX] PULSIN running at 5mhz VS 50mhz'
2009\03\05@054234 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

I am currently using PULSIN to read RPM's but I have changed the code that can be found on other threads for reading RPM's to output a byte variable instead of a word.  I have noticed the other RPM code is run at 50MHZ.  Would this affect my output since I only run the chip at 5MHZ?  Since I have 2 commands to read the high and low pulse times, I figure that the delay before the 2nd PULSIN is run may mess up some things.  The accuracy of my code is +/- 100 rpm according to the tach, but sometimes it will go haywire and the RPM output would be 10,000 or 0 even though I am at 2500 RPM.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\03\05@065814 by beann/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote:

You don't have any interrupts do you ? They will mess up the reading if an interrupt occurs while it is measuring.

Bean.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425#m333436
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\03\05@164530 by Zootn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Zoot wrote:

eagletalontim -- if you were using PULSIN at 50mhz with any interrupts, you might have "gotten away with it" given the relatively low frequency of your RPMs. At 5mhz you may not. I've read a good number of your posts on this project, and seen some of Jon's code -- if you want to accurately measure ticks from a tach sensor, and if you want nice clean serial, it really would be best to use serial RX/TX (with a nice-sized buffer) in an ISR and fold your ticks measurements in there. Then your mainline will be pretty clean -- wait for serial request from host, then send current count (or a parsed version thereof, say accumulated counts, or counts divided into a standard timebase, e.g. RPM), and rock solid. Probably take a lot less code space too.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425#m333551
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\03\05@174142 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

No, there are no interrupts since I want to stay away from them because the timing issues and me not having a clue how to work with them :p  I tried to use interrupts but since I only need to read the sensors when needed, I don't think an interrupt is necessary.  Same goes with the serial connection.  Data is only sent when needed.  It could be 1 hour before data is sent to the next chip or it could be 1 second.  If there was someone I could trust with my code, I would send it to them to possibly help me better understand how to clean up my code and make it more efficient.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425#m333561
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\03\05@180951 by Zootn/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Zoot wrote:

Right. And what if a tick from the tach sensor comes in *while* you are SERINing or SEROUTing? You'll miss it and get inaccurate counts.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425#m333572
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\03\05@190401 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

the RPM function is called while in the running mode.  If serial data needs to be sent, it will only send it after the RPM has been read.

Here is an example :
[CODE]
'  These are all functions....
sensor1 = getsensor1
sensor2 = getsensor2
rpm = getrpm
....
'Do stuff with the data....
....
IF data_to_send = 1 THEN
  SEND_BYTE ShowData, label, data, multiplier  ' This is also a function
ENDIF[/CODE]
[CODE]
'Receiving chip
Main:
 FOR idx = 0 TO 3
   cmd = RX_BYTE
   IF cmd = SYNC THEN Main                ' fix busted packet
   in(idx) = cmd
 NEXT
.....
[/CODE]
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425#m333581
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\03\05@212715 by JonnyMacn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote:

Do you *really* think the people you intend to sell this product to are going to be cruising this board?  If they were, would they have confidence in the product based on the difficulties you had?... Post you code and let us give you some real help! :tongue:

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425#m333605
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\03\05@212911 by JonnyMacn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote:

If the external device can transmit any time it wants you will run into troubles.  If you won't use interrupts (which would make this academic) you might consider flow-control to stop the other device from sending when you're not ready for data.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425#m333606
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\03\06@192449 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

ok, I have been working my hardest to get this working and accurate but I am having no luck :(  I have the code posted below which works, but is not 100% accurate all the time.  What is happening is while I am still in first gear, the RPM is pretty accurate up to about 5000 RPM....anything above that is 500 RPM off.  The faster I get up into the high RPM range, the more accurate it seems to be.  When in second gear and at 6500 on the stock tach, the RPM on the LCD reads 5500.  And the strange thing is that at 2000 RPM in neutral reads 2000 RPM's on the LCD.  What could be causing the inaccurate results at a high RPM?  I do not have access to a scope so tracking this down is almost impossible for me :(
[CODE]FUNC getrpm
 PULSIN RPM_signal, 0, tmpW1
 PULSIN RPM_signal, 1, tmpW2
 tmpW1 = tmpW1 + tmpW2
 tmpW1 = tmpW1 * 2               'Double the signal since there are 2 pulses per revolution.
 tmpW1 = 60000 / tmpW1        'Divide by 60,000 to output Byte in _LSB and save space.
 RETURN tmpW1_LSB
 ENDFUNC[/CODE]
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425#m333868
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\03\06@194822 by peterverkaikn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, peterverkaik wrote:

At least simplify your calculation which also reduces
chance on overflow.

Try



FUNC getrpm
 PULSIN RPM_signal, 0, tmpW1
 PULSIN RPM_signal, 1, tmpW2
 tmpW1 = tmpW1 + tmpW2
 tmpW1 = 30000 / tmpW1        'Divide by 30,000 to output Byte in _LSB and save space.
 RETURN tmpW1_LSB
 ENDFUNC

See if your results are better now.

regards peter


---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425#m333871
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\03\07@050347 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

ok, did not think about that :p  what would be the best way to detect an overflow if it did happen?

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425#m333942
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\03\07@145807 by VelocitąPaolan/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, VelocitąPaola wrote:

Check the carry bit (bit 0) in the STATUS register.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425#m334052
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\03\07@190943 by Desy2820n/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Desy2820 wrote:

I don't have an SX.  Just thought I'd throw this out there:  Check some of the basics, such as: How clean is your power input?  I ask because I think you're testing this in a car, which is a harsh electrical environment for anything.  Are you using the car's electrical system to power the SX?  If so, make sure that your have plenty of filtering on the input power.  If you're using seperate supplies, is the sensor powered from the SX supply or the car?  You may need to connect your power supply grounds together, so they have a common reference point.  You do have to be careful, as you can also pick-up noise through this connection.

How far apart are the SX and sensor?  Could you be picking up high-frequency noise on the input line from the sensor?  Try changing the routing of the wire, too close to the alternator/generator, spark plug wires, motors or the distributor can induce lots of other frequencies, which may swamp the one you're trying to measure.

I hope this helped, or at least gives you food for thought.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425#m334095
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\03\08@072738 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

The board is powered by the stock wiring harness and all the sensors are connected to the same harness allowing for short connections to be made.  I am going to attempt to get an o-scope so I can see the signal and if it is clean or not.  The power is connected to a 10uf cap which goes through a 7805 regulator.  Each chip has a .001uf cap across the Vdd and Vss terminals.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425#m334174
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\03\09@192042 by eagletalontimn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, eagletalontim wrote:

so far, I have not been able to find an O-Scope :(  If there was trash being sent through the sensor line, what would be the best way to clean it up to a good input?

[QUOTE]Check the carry bit (bit 0) in the STATUS register.[/QUOTE]
How would I check the bit?

IF tmpW1.0 = 1 THEN
'... do something?
ENDIF
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425#m334546
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\03\09@194945 by Zootn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Zoot wrote:

IF C = 0 THEN or
IF C = 1 THEN
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=333425#m334551
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

More... (looser matching)
- Last day of these posts
- In 2009 , 2010 only
- Today
- New search...