Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Analogue Source Turntables, Tonearms, Cartridges, Phono Stages, Tuners, Tape Recorders, etc.

Digital Tachometer for record player (LCD display)
Digital Tachometer for record player (LCD display)
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 22nd June 2017, 07:29 PM   #101
tauro0221 is offline tauro0221  United States
diyAudio Member
 
Join Date: Nov 2008
Location: Victoria,TX
Hi,
On the Falcon do you have a time frame to update the Rpm or you just sent it any time?
  Reply With Quote
Old 22nd June 2017, 07:56 PM   #102
Pyramid is offline Pyramid  United States
diyAudio Member
 
Pyramid's Avatar
 
Join Date: May 2006
Location: Behind the Cheddar Curtain
Quote:
Originally Posted by tauro0221 View Post
Hi,
On the Falcon do you have a time frame to update the Rpm or you just sent it any time?

The rx sio is interrupt driven, so it can occur at any time. The ISR for the sio buffers the characters as they come in and sets a flag upon receipt of ASCII(13). The main routine constantly scans for the flag and if set, parses the stored string and takes appropriate action. If no data is received from the tach, no correction is ever applied. If data is received and is in the correct format, the decision to apply correction (and how much) is calculated for each received message.
  Reply With Quote
Old 22nd June 2017, 08:18 PM   #103
Pyramid is offline Pyramid  United States
diyAudio Member
 
Pyramid's Avatar
 
Join Date: May 2006
Location: Behind the Cheddar Curtain
Quote:
Originally Posted by tauro0221 View Post
Hi,
The reason why I use the 3 pulse interrupt it is to be ready to wait for the interrupt in the routine. This will remove the delay of the interrupt branch time service. It will give you a more steady Rpm ready from the sensor.
I just pored through the data sheet for the ATMega328; one of the strangest interrupt schemes I've ever seen. It is basically single level: When ANY interrupt occurs, the global flag is cleared disabling all other interrupts until the current ISR is complete. If other interrupts occurred during the first ISR, they are latched then processed after the 1st ISR is complete, in the order of their interrupt vector address (lowest address=highest priority). There is no way to assign a higher priority to a low level routine that counts microseconds (or that captures them when an external pin goes low) as in most of the 8051 derivatives. The software can set the global interrupt enable flag within an ISR that will allow nested interrupts, but there still is no priority and ANY interrupt source can interrupt ANY other ISR regardless of vector address.

You definitely want to keep your ISR as short as possible, but the Arduino operating system is using Timer0 for micros() and millis(), so there is no way to prevent these from delaying your code from reading the results. A delay is no problem, as long as it is consistent each time. The display bobble is caused by variable delays on each attempt to read the count. Putting lots of processing and output routines in your ISR prevents micros() and millis() from working properly.
  Reply With Quote
Old 22nd June 2017, 08:22 PM   #104
Pyramid is offline Pyramid  United States
diyAudio Member
 
Pyramid's Avatar
 
Join Date: May 2006
Location: Behind the Cheddar Curtain
Tauro0221 and Packgrog- Let me ask you guys something:

1. What attracted you to the Arduino platform?

2. Why did you not do this project in assembly language with a more conventional processor?

3. If there was an easy to use hardware platform based on an 8051 derivative with and IDE, would doing a project like this be more attractive in assembly?
  Reply With Quote
Old 22nd June 2017, 08:25 PM   #105
Packgrog is offline Packgrog  United States
diyAudio Member
 
Join Date: Jan 2015
Location: Philadelphia area
Check! Fixed that in latest version. Should be much more responsive going forward. The feedback is much appreciated. Will give it another go tonight.

I do wish the RS232 shield didn't block out the necessary ports for uploading sketches, even in Softserial mode. It's such a PITA to remove and put back on. :P
  Reply With Quote
Old 22nd June 2017, 08:42 PM   #106
Packgrog is offline Packgrog  United States
diyAudio Member
 
Join Date: Jan 2015
Location: Philadelphia area
My answers:
Quote:
Originally Posted by Pyramid View Post
1. What attracted you to the Arduino platform?
Purely this project, and the progress made by others, particularly tauro0221.

Quote:
2. Why did you not do this project in assembly language with a more conventional processor?
See above. Others had success already with the Arduino, it's cheap, and it's easy to learn from. I also have far more experience with C, which I used for the first few years of my career before moving to mostly database work and web scripting, than I ever did with assembly, which I only did in one class in college back in the mid-90's. I'm sure I COULD do it, but the learning curve would be much higher for me.

Quote:
3. If there was an easy to use hardware platform based on an 8051 derivative with and IDE, would doing a project like this be more attractive in assembly?
*shrug* Could be. Depends on availability of parts, ease of learning the necessary code, lack of needing to solder anything (sadly a bigger deal for me, even though I do have a kit for doing so). I'm more a coder and Lego-style builder than a welder.

But we'll see how this goes once I update my setup tonight. Like I said, the numbers seemed much better with tauro0221's original sketch were better than with my first attempt, so it could be that the tinier ISR with micros() call on the first line will be enough to improve the wild variation in speed estimate.

Last edited by Packgrog; 22nd June 2017 at 08:49 PM. Reason: Holy run-on sentences, Batman
  Reply With Quote
Old 22nd June 2017, 08:55 PM   #107
Pyramid is offline Pyramid  United States
diyAudio Member
 
Pyramid's Avatar
 
Join Date: May 2006
Location: Behind the Cheddar Curtain
Quote:
Originally Posted by Packgrog View Post
Availability of parts, ease of learning the necessary code, lack of needing to solder anything (sadly a bigger deal for me, even though I do have a kit for doing so). I'm more a coder and Lego-style builder than a welder.
What if there was an Arduino-like platform (all hardware already mounted, USB interface, GPIO pins) that would accept the same "shields"; essentially an Ardruino clone, but based on an 8051 and all of the code would be written in assembly instead of C. Libraries of code to do almost anything (LED, LCD, serial functions, keypads, rotary encoders, EEPROMS, ADC, DAC, etc.).
  Reply With Quote
Old 22nd June 2017, 09:00 PM   #108
tauro0221 is offline tauro0221  United States
diyAudio Member
 
Join Date: Nov 2008
Location: Victoria,TX
Hi,
To:Pyramid
Originally I was using the Zbasic software but they also used the 328P micro. But the difference I was using the PWM to control the Rpm. The problem it is that you need to do your own PCB board. Now you can buy an Arduino board for pennies than make your own costly board. Assembly language it is faster but you need some expertise using it. Basic is it simple to program but depending how the instructions are built that will depend the executing time that they will consume.

That is why asked how often you need to sent the data update to the Falcon controller. Do you need to sent it in a time frame or when you see a changes in the Rpm.
  Reply With Quote
Old 22nd June 2017, 09:04 PM   #109
Packgrog is offline Packgrog  United States
diyAudio Member
 
Join Date: Jan 2015
Location: Philadelphia area
Quote:
Originally Posted by Pyramid View Post
What if there was an Arduino-like platform (all hardware already mounted, USB interface, GPIO pins) that would accept the same "shields"; essentially an Ardruino clone, but based on an 8051 and all of the code would be written in assembly instead of C. Libraries of code to do almost anything (LED, LCD, serial functions, keypads, rotary encoders, EEPROMS, ADC, DAC, etc.).
I think that would be fascinating. I wonder what projects (apart from this one) would see a measurable benefit in going that route rather than the Arduino & C. There's clearly a benefit in THIS instance (though I do hope that it won't be THAT significant with my latest updates, that would be frustrating), but I'm not sure where else in basically student-level cheap equipment that the fraction of a millisecond improvement will be as big a deal. With enough uses, it could be as nice of a teaching tool as the Arduino likely has been.
  Reply With Quote
Old 22nd June 2017, 09:18 PM   #110
Pyramid is offline Pyramid  United States
diyAudio Member
 
Pyramid's Avatar
 
Join Date: May 2006
Location: Behind the Cheddar Curtain
Quote:
Originally Posted by Packgrog View Post
I think that would be fascinating. I wonder what projects (apart from this one) would see a measurable benefit in going that route rather than the Arduino & C. There's clearly a benefit in THIS instance (though I do hope that it won't be THAT significant with my latest updates, that would be frustrating), but I'm not sure where else in basically student-level cheap equipment that the fraction of a millisecond improvement will be as big a deal. With enough uses, it could be as nice of a teaching tool as the Arduino likely has been.
One of the reasons I'm thinking about this as a possibility is the Arduino (and for that matter, the C language) isolates the user from understanding the inner workings of the P. Maybe that's a good thing in some cases, but I think an Arduino clone based on assembly would be a valuable learning tool.

The ATMega328 has a lot of capability that is hidden by the Arduino IDE. The capability is there to access all of it, but you have to delve into the details of the processor and control registers; at that point, you might as well go assembly.

I have to say that I'm really disappointed in the way the 328 handles interrupts. To me, it is quite limiting, not just in this application, but almost any M2M design.

Anyway, sorry to go off-topic.
  Reply With Quote

Reply


Digital Tachometer for record player (LCD display)Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Digital Turntable Tachometer and DDS based PSU Pyramid Vendor's Bazaar 234 6th November 2017 01:57 AM
The new 5-Record-Player.... M_Balou The Lounge 5 18th October 2016 11:38 PM
Old record player Rucyrius Everything Else 0 24th March 2011 03:35 PM
Change old cd player display to LCD, easy? Tubeee Digital Source 0 7th December 2003 12:03 PM


New To Site? Need Help?

All times are GMT. The time now is 03:43 AM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 14.29%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
Copyright ©1999-2019 diyAudio
Wiki