Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #39037
| From | rickman <gnuarm@gmail.com> |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: A Little Help Here? |
| Date | 2015-05-12 13:51 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <mitehm$3al$1@dont-email.me> (permalink) |
| References | <mis0te$p1v$1@dont-email.me> <misbbb$njk$1@dont-email.me> <op.xyijlhbswa0t4m@localhost> <7c669a2b-5b61-4943-bfca-55477572e8bf@googlegroups.com> |
On 5/12/2015 10:48 AM, Tessa Bonting wrote:
> Op dinsdag 12 mei 2015 10:08:51 UTC+2 schreef Rod Pemberton:
>
>>
>>> Nevermind. I spent a little more time on it and found there was some
>>> overlap of the different digits on the select lines. So I ignore any
>>> digit selects that aren't one-hot and it is working fine now.
>>>
>>
>> So, the one-hot digit selects weren't actually one-hot, but two- or
>> three-hot ... ?
>>
>> Was the data being latched? So, this was just some sampling jitter?
>>
>> You didn't post your Forth fix, so I'm left wondering if an adjustment
>> to 'delay' in newdigit@ would've fixed this issue or not.
The fix was to reject anything that wasn't a one-hot value. The delay
was only inserted to allow viewing of the debug data on the output
without being overrun. I don't have the old code, but here is the new
code, actually *very* new. I just rewrote some of it for simplification
and I no longer have the code I tested last night. So this is untested
and may have Jeff Fox counting bugs (as in, "it proves you can't count").
: one-hot ( n1 -- n2 ) \ return value if exactly one bit set
case
1 of 1 endof
2 of 2 endof
4 of 3 endof
0 ( default )
endcase ;
: newdigit@ ( c1 -- c2 ) \ sync to new digit
begin digits@ one-hot 2dup = over 0= or key? not and while
drop delay repeat nip ;
This code should work fine without the delay. If you would like I'll
test it without the delay.
> When I was programming for digital readout systems, like AtoD converters,
> I allways used to swith the display of by writing a all segments off
> to the display post, change the digit number and afther a little delay
> the new digit segment info to the proper port.
> This just to get rid of aftherclow of the prefious to the next digit.
> Thats why there is a possibility to read a double change.
> Succes, Tessa
The LEDs are being driven by an MCU. I expect they are changing the
digit selects and the segment drives at the same time. Still, that
would be a very low likelyhood that my MCU would see them both set at
the same time (a few nanoseconds every 5 milliseconds). I think it is
likely that there is some slowness to the voltage transitions. The
anodes are pulled up hard by the outputs and tristated for a low which
means they are pulled down passively so the transitions are relatively
slow. Actually I have seen this on the scope and didn't give it much
attention. The only reason the undriven anodes pull down at all is the
10 kohm voltage dividers I added for 5v > 3v on the MCU inputs.
--
Rick
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
A Little Help Here? rickman <gnuarm@gmail.com> - 2015-05-12 00:53 -0400
Re: A Little Help Here? rickman <gnuarm@gmail.com> - 2015-05-12 03:51 -0400
Re: A Little Help Here? rickman <gnuarm@gmail.com> - 2015-05-12 03:54 -0400
Re: A Little Help Here? "Rod Pemberton" <bork@lllljunkqwer.cpm> - 2015-05-12 04:09 -0400
Re: A Little Help Here? Tessa Bonting <tessa.bonting@gmail.com> - 2015-05-12 07:48 -0700
Re: A Little Help Here? rickman <gnuarm@gmail.com> - 2015-05-12 13:51 -0400
Re: A Little Help Here? "Alex McDonald" <blog@rivadpm.com> - 2015-05-12 19:46 +0100
Re: A Little Help Here? "Alex McDonald" <blog@rivadpm.com> - 2015-05-12 19:53 +0100
Re: A Little Help Here? rickman <gnuarm@gmail.com> - 2015-05-12 20:15 -0400
Re: A Little Help Here? "Elizabeth D. Rather" <erather@forth.com> - 2015-05-12 19:29 -1000
Re: A Little Help Here? rickman <gnuarm@gmail.com> - 2015-05-12 21:18 -0400
Re: A Little Help Here? all2001@spambog.com (Wolfgang Allinger) - 2015-05-12 08:37 -0300
Re: A Little Help Here? rickman <gnuarm@gmail.com> - 2015-05-12 20:18 -0400
Re: A Little Help Here? all2001@spambog.com (Wolfgang Allinger) - 2015-05-12 23:08 -0300
Re: A Little Help Here? rickman <gnuarm@gmail.com> - 2015-05-13 03:31 -0400
Re: A Little Help Here? all2001@spambog.com (Wolfgang Allinger) - 2015-05-13 07:32 -0300
Re: A Little Help Here? rickman <gnuarm@gmail.com> - 2015-05-13 16:47 -0400
Re: A Little Help Here? all2001@spambog.com (Wolfgang Allinger) - 2015-05-13 17:48 -0300
Re: A Little Help Here? rickman <gnuarm@gmail.com> - 2015-05-13 22:01 -0400
Re: A Little Help Here? Tessa Bonting <tessa.bonting@gmail.com> - 2015-05-13 08:56 -0700
Re: A Little Help Here? Tessa Bonting <tessa.bonting@gmail.com> - 2015-05-13 09:22 -0700
Re: A Little Help Here? rickman <gnuarm@gmail.com> - 2015-05-13 16:56 -0400
csiph-web