SHIFTOUT frustration
Michael-
Does the '2406 present 5K ohms upon powerup as expected?
Are the Stamp and '2406 connected via grounds? Would you describe
your '2406 wiring scheme in detail?
Are you using pullup/pulldown resistors on your rst*, clock and data
pins (5, 6 and 8)? If not, I'd try tying at least rst* through a
4.7K resistor to ground at least. That way its logic level will not
be ambiguous at startup and later when the program wanders into
the unknown at the end.
Add the following line at the end of your program:
idle: GOTO idle
When your program doesn't remain actively executing instructions,
all pins become inputs every once in a while (see the manual). In
your case, it may be that allowing the rst* to float momentarily
means the '2406 goes into the "give me 17 bits or I'm gonna do the
wrong thing" mode. Aside from that, I can't see a problem with your
code.
Regards,
Steve
Does the '2406 present 5K ohms upon powerup as expected?
Are the Stamp and '2406 connected via grounds? Would you describe
your '2406 wiring scheme in detail?
Are you using pullup/pulldown resistors on your rst*, clock and data
pins (5, 6 and 8)? If not, I'd try tying at least rst* through a
4.7K resistor to ground at least. That way its logic level will not
be ambiguous at startup and later when the program wanders into
the unknown at the end.
Add the following line at the end of your program:
idle: GOTO idle
When your program doesn't remain actively executing instructions,
all pins become inputs every once in a while (see the manual). In
your case, it may be that allowing the rst* to float momentarily
means the '2406 goes into the "give me 17 bits or I'm gonna do the
wrong thing" mode. Aside from that, I can't see a problem with your
code.
Regards,
Steve
Comments
idea is to try to move the wiper using
SHIFTOUT. The wiper position is monitored with an ohmeter as I run the program,
below. Nothing happens. The wiper does
not move. The wiring is correct. The stamp works, and has performed well on
other projects. The pot chip is probably
okay -- I have a backup chip, and switched pots by way of troubleshooting the
hardware. So it comes down to
software.
Here it is. It should be a straightforward synchronous serial transfer of data,
but ... brickwall.
'{$STAMP BS2}
'this is TRY67.BS2. Idea is to try to make the 1267-10 work.
'The first step is to declare variables and constants.
'Then enable the 1267 chip with the reset pin, P5
'then do the SHIFTOUT command
'Then return the reset line to low. At this, the wiper should move.
'For reference, Pin 5 is RST , Pin 8 is DATA , and Pin 6 is the CLOCK
'The pin numbers of the stamp are selected to correspond with
'the pin numbers of the potentiometer chip, to simplify the wiring check
WIPER1 VAR BYTE
WIPER0 VAR BYTE
WIPER1=50
WIPER0=1
'Either wiper can be set to a position between 1 and 255
OUTPUT 5 'The Reset line
OUTPUT 8 'The Data line
OUTPUT 6 'The Clock line
HIGH 5 'pin 5 goes high to reset the 1267
'Here is a template for the SHIFTOUT command
'SHIFTOUT DATA, CLOCK, MODE, [noparse][[/noparse]WIPERSELECT \1,WIPER1 \8,WIPER0 \8]
'Here is the actual SHIFTOUT command:
SHIFTOUT 8, 6, MSBFIRST, [noparse][[/noparse]0 \1, WIPER1 \8, WIPER0 \8]
LOW 5 'Wiper will not shift its position until Reset goes low.
Assuming it's been wired up correctly. You did triple check your hookups?
I had a lot of trouble getting the DS1820 thermometer chips to work right.
One day they'd work ok, the next they'd all go crazy on me (all I did was
power it up from one day to the next). Anyway, it looked like it might have
been some sort of temperature sensitivity, when the temp would go over 80F
they'd all flake out on me. But I couldn't tell if it was the BS2 or the
DS1820's or combination. At 65 to 70F everything seemed to work Ok, but
above 70F I'd start to see random glitches where the temp would spike for a
reading, then go back to normal on the next reading.
I found a DS1481 buss master chip and it seemed to solve all the problems,
at least the readings are a lot more consistant now.
The DS2480 serial port to 1 wire buss master chip looks even more promising,
with even less hassle.
The clock or pulse timing seems to be very tricky on these 1-wire things.
regards,
Earl
Original Message
From: Michael Gianturco [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=cP3yhzSHM85wnskq01IesQ6xlXqmTH2RHlsQvhHrIQH6gWfqAcbaKz-Li6QjKStfT6wOtqiC9QZaEl1IlwA]michcg@m...[/url
Sent: Tuesday, December 18, 2001 9:15 PM
To: basicstamps@yahoogroups.com
Subject: Re: [noparse][[/noparse]basicstamps] SHIFTOUT frustration
Still trying to make a success of my Dallas Semiconductor 1267 digital pot.
The idea is to try to move the wiper using
SHIFTOUT. The wiper position is monitored with an ohmeter as I run the
program, below. Nothing happens. The wiper does
not move. The wiring is correct. The stamp works, and has performed well on
other projects. The pot chip is probably
okay -- I have a backup chip, and switched pots by way of troubleshooting
the hardware. So it comes down to
software.
Here it is. It should be a straightforward synchronous serial transfer of
data, but ... brickwall.
'{$STAMP BS2}
'this is TRY67.BS2. Idea is to try to make the 1267-10 work.
'The first step is to declare variables and constants.
'Then enable the 1267 chip with the reset pin, P5
'then do the SHIFTOUT command
'Then return the reset line to low. At this, the wiper should move.
'For reference, Pin 5 is RST , Pin 8 is DATA , and Pin 6 is the CLOCK
'The pin numbers of the stamp are selected to correspond with
'the pin numbers of the potentiometer chip, to simplify the wiring check
WIPER1 VAR BYTE
WIPER0 VAR BYTE
WIPER1=50
WIPER0=1
'Either wiper can be set to a position between 1 and 255
OUTPUT 5 'The Reset line
OUTPUT 8 'The Data line
OUTPUT 6 'The Clock line
HIGH 5 'pin 5 goes high to reset the 1267
'Here is a template for the SHIFTOUT command
'SHIFTOUT DATA, CLOCK, MODE, [noparse][[/noparse]WIPERSELECT \1,WIPER1 \8,WIPER0 \8]
'Here is the actual SHIFTOUT command:
SHIFTOUT 8, 6, MSBFIRST, [noparse][[/noparse]0 \1, WIPER1 \8, WIPER0 \8]
LOW 5 'Wiper will not shift its position until Reset goes low.
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> Does the '2406 present 5K ohms upon powerup as expected?
Yes. The wiper went to the center of its range on the first powerup, and now it
just stays there. The pot is
designated DS1267-10. It is a dual pot. Both wipers went to center on powerup.
> Are the Stamp and '2406 connected via grounds? Would you describe
> your '2406 wiring scheme in detail?
I am using a BOE board, which includes a regulated power supply and ground for
the stamp. The 1267 pot chip is
connected to the BOE board's +5 volt supply via its pin 14, and to the common
ground via its pin 7.
Otherwise it is just pin-to-pin wiring. Pin 6 of the stamp is wired directly to
pin 6 of the chip, which is the
CLK input. Pin 5 of the stamp is wired directly to pin 5 of the chip, which is
the RST. Pin 8 of the stamp is
wired directly to pin 8 of the chip, which is the Data input pin. The pin
correspondence is 1:1 just to make it
easy to "proofread" the wiring.
>
> Are you using pullup/pulldown resistors on your rst*, clock and data
> pins (5, 6 and 8)?
There are none. Normally I use a cookbook (the Microcontroller application
Cookbook) or the Williams or Edwards
books, and simply reproduce the exact circuit I need. But there is nothing in
the books about the 1267, nor does
the Dallas Semi datasheet suggest anything about discrete components. I sense
that I am supposed to know about
pullups and pulldowns -- these are terms I encounter very frequently in the
books -- but I am afraid I still don't
know what they actually mean. In other words, the "which way" is clear enough
(up or down) but what pulls what?
> If not, I'd try tying at least rst* through a
> 4.7K resistor to ground at least. That way its logic level will not
> be ambiguous at startup and later when the program wanders into
> the unknown at the end.
>
I'll try this. Thank you.
>
> Add the following line at the end of your program:
>
> idle: GOTO idle
> Okay, done.
> Thank you for these ideas. I will try them and report how it turns out.
>
[noparse][[/noparse]Non-text portions of this message have been removed]