BasicMicro - Forums

www.basicmicro.com
It is currently Mon May 21, 2012 12:42 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Shiftout or me, one is broken
PostPosted: Mon Aug 22, 2011 12:32 pm 
Offline
Guru

Joined: Mon Apr 19, 2010 9:13 am
Posts: 63
Shiftout seems to have stopped working on my BAN40. I can toggle the data pin manually, but for some reason I don't seem to be able to get it to toggle with shiftout. I've tried using a different data pin with the same results. I'm using an ancient Tektronix 222 (10MHz) scope, but it still works. Any glaring errors here? The scope leads are hooked directly to the pins and I have disconnected all external circuits at this point.

edit: to clarify, the scope is connected to the pins on the dev board, not directly to the BAN40. Also, it appears shiftout functions quicker than the simple program. Zooming in results, the clock pulses are nice and square... all 8 of them.

This code:
Code:
CLK CON P19
DAT CON P14

MAIN
   HIGH CLK
   HIGH DAT
   LOW DAT
   LOW CLK
GOTO MAIN


Results in this:
Image

However, this code:
Code:
CLK CON P19
DAT CON P14

HIGH CLK
MAIN
   SHIFTOUT DAT, CLK, LSBPRE, [$AA\8]
GOTO MAIN


Results in this:
Image

_________________
Studio 2.0.0.16 on Win 7 Home x64 updated daily - Original Roboclaw 5A V1.3.9
Mostly a Nano40 for prototyping, but I have others in my bins


Top
 Profile  
 
 Post subject: Re: Shiftout or me, one is broken
PostPosted: Tue Aug 23, 2011 10:06 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
What version of Studio are you using?

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Shiftout or me, one is broken
PostPosted: Tue Aug 23, 2011 1:29 pm 
Offline
Guru

Joined: Mon Apr 19, 2010 9:13 am
Posts: 63
2.0.0.14 on Win 7 Home x64

And an update, it works just fine on pins 0-7. Do the pull-ups have something to do with that? :?

_________________
Studio 2.0.0.16 on Win 7 Home x64 updated daily - Original Roboclaw 5A V1.3.9
Mostly a Nano40 for prototyping, but I have others in my bins


Top
 Profile  
 
 Post subject: Re: Shiftout or me, one is broken
PostPosted: Wed Aug 24, 2011 8:53 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Internal pullups aren't enabled unless you activate them in code so I don't see any way that could be the case. Do you have Auto or AtomPro 40 set in the drop down chip selection?

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Shiftout or me, one is broken
PostPosted: Thu Aug 25, 2011 1:00 pm 
Offline
Guru

Joined: Mon Apr 19, 2010 9:13 am
Posts: 63
BAN 40 is selected.

_________________
Studio 2.0.0.16 on Win 7 Home x64 updated daily - Original Roboclaw 5A V1.3.9
Mostly a Nano40 for prototyping, but I have others in my bins


Top
 Profile  
 
 Post subject: Re: Shiftout or me, one is broken
PostPosted: Thu Aug 25, 2011 5:41 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Found the bug. If the 2 pins used are on different ports the dataport never gets set as an output. I've fixed it and will update the release tomorrow.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Shiftout or me, one is broken
PostPosted: Fri Aug 26, 2011 8:04 am 
Offline
Guru

Joined: Mon Apr 19, 2010 9:13 am
Posts: 63
Excellent! I'm not crazy afterall.

_________________
Studio 2.0.0.16 on Win 7 Home x64 updated daily - Original Roboclaw 5A V1.3.9
Mostly a Nano40 for prototyping, but I have others in my bins


Top
 Profile  
 
 Post subject: Re: Shiftout or me, one is broken
PostPosted: Fri Aug 26, 2011 8:10 am 
Offline
Master

Joined: Tue Nov 21, 2006 9:34 am
Posts: 527
Good find Nathan,

I was wondering if there was some issue with the init code. I was going to suggest trying something like:
Code:
CLK CON P19
DAT CON P14

HIGH CLK
OUTPUT DAT
MAIN
   SHIFTOUT DAT, CLK, LSBPRE, [$AA\8]
GOTO MAIN


To see if that would get you limping along...

Kurt


Top
 Profile  
 
 Post subject: Re: Shiftout or me, one is broken
PostPosted: Fri Aug 26, 2011 11:49 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Ya. I tried something like that too but the pin wouldn't budge so I had to dig a bit deeper. A bit of simulation later and there is was. The FSR register wasn't returning with the expected port register address if the clock pin used a different port than the data pin which caused the code that sets the dat pin as an output to set a different pin as an output. I fixed it so the fsr register is reloaded with the dat address after the setup call so that won't be a problem anymore. It now is outputing data on the dat pin like you would exepct whatever the pin used.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO