BasicMicro - Forums

www.basicmicro.com
It is currently Mon May 21, 2012 8:29 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Shiftin command to read from digital scales
PostPosted: Mon May 31, 2010 12:03 pm 
Offline
Citizen

Joined: Mon May 31, 2010 11:52 am
Posts: 5
Hello,

I'm trying to use an Atom Pro 24M to read 48 bits of data from a digital scale for use on a DRO for a mill. Some details of the scale protocol is here: http://www.yadro.de/digital-scale/protocol.html#a2

The problem is that I need to clock the pulses in based on the clk FROM the scale, and apparently the Atom Pro SHIFTIN command wants to supply the clock. Is this true for the ATOM nano as well? The manual says the pro "is Always the master", it doesn't say if the non-pro versions are this way also.

Anybody have any ideas how to do this? Is there a command I missing that would work?

Dylan


Top
 Profile  
 
 Post subject: Re: Shiftin command to read from digital scales
PostPosted: Mon May 31, 2010 1:17 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Correct. Shiftin/shiftout are master only commands on all processors. You can use the processors hardware syncronous serial port to do what you want but it is very advanced word. You will need to read the Renesas 3694 datasheet section on the syncronous serial port and how to set it up as a slave port. Atom and Nano(our PICmicro based processors) also have syncronous serial port hardware. If you switch to one of those you will need to look at their respective PICmicro datasheets.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Shiftin command to read from digital scales
PostPosted: Mon May 31, 2010 5:40 pm 
Offline
Citizen

Joined: Mon May 31, 2010 11:52 am
Posts: 5
Hmmm.. Well I think I might see how to set up the HW serial ports to do synchronous serial input, but I'm not sure that I have access to all the registers from Basic. I would have to play with it a bit.

However, this won't really work for me because I need to read from 3 different scales, with separate clk and data pins for each. Not at the same time, but still....

Maybe I can do this using some sort of bit-banging type approach. Is there a list somewhere of how many clock cycles each of the basic commands take to execute?

Dylan


Top
 Profile  
 
 Post subject: Re: Shiftin command to read from digital scales
PostPosted: Mon May 31, 2010 7:48 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Most SPI devices have chip enable pins. You should be able to use the same clock and data pins as long as you only need to talk to one at any instant. Also you have access to all the registers from basic. All the registers as defined in the Renesas data sheet are available as basic variables.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Shiftin command to read from digital scales
PostPosted: Mon May 31, 2010 10:37 pm 
Offline
Citizen

Joined: Mon May 31, 2010 11:52 am
Posts: 5
These devices don't have a chip enable. I have power, data and clock. Even if I did figure out a way to switch between the devices, which would probably mean additional hardware, I still don't see a way to have it recognize the long clk pulse as the beginning of new word.

My attempt at bit-banging it in failed also, but that could be a problem with my code.

It just doesn't seem like this uController is really suitable for this application.

Dylan


Top
 Profile  
 
 Post subject: Re: Shiftin command to read from digital scales
PostPosted: Mon May 31, 2010 10:37 pm 
Offline
Citizen

Joined: Mon May 31, 2010 11:52 am
Posts: 5
These devices don't have a chip enable. I have power, data and clock. Even if I did figure out a way to switch between the devices, which would probably mean additional hardware, I still don't see a way to have it recognize the long clk pulse as the beginning of new word.

My attempt at bit-banging it in failed also, but that could be a problem with my code.

It just doesn't seem like this uController is really suitable for this application.

Dylan


Top
 Profile  
 
 Post subject: Re: Shiftin command to read from digital scales
PostPosted: Tue Jun 01, 2010 12:02 am 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
I noticed the site you provided to explain the protocol provided some o-scope trace printouts. I noticed these signals don't reach 2V (the vertical settings appear to be 0.5V per major division), so may not be readable by this processor module. This may explain why all this isn't working for you. Do you have an oscilloscope (beg, borrow or buy) you can check your scales' levels with?
'Luck.

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Shiftin command to read from digital scales
PostPosted: Tue Jun 01, 2010 7:45 am 
Offline
Citizen

Joined: Mon May 31, 2010 11:52 am
Posts: 5
I have the signals coming from the scale going through a voltage comparator to adjust the voltage levels. I have a bad toy o-scope, but it works well enough to see that I have pulse trains going to the pins of the Basic Atom.

Thanks for looking at it though.

Dylan


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO