Menu

Pin names on "generic" logic

Help
2018-09-09
2018-09-11
  • Least Significant Bit

    What do the pin names on the generic logic components signify? Where is DCC and GND? Is ">" the latch clock or the shift clock (assuming shift clock since it wouldn't work without one). Is "m" "output enable"?

    I've tried a few ways of wiring it up but cannot get it to work!

     

    Last edit: Least Significant Bit 2018-09-09
  • Santiago

    Santiago - 2018-09-09

    logic devices have no power pins, they are powered when you swith circuit on.

    This is a bare shift register, no latch here, so ">" is shift clock.

    Output enable is "OE", vertical pins have labels also vertical.

    "I've tried a few ways of wiring it up but cannot get it to work! "
    Have you tried with reset pin Hight? ( note that "OE" and "Rst" are inverted )
    It works normally for me.

     
  • Least Significant Bit

    I'm sorry, I just cannot get this to work :( Spent an hour with the 74HC595 and I'll be damned if I can get any of the outputs to go high. The datasheet suggests that in this configuration all outputs should be high:

    Edit: Scratch that; I misread. Check instead the more elaborate example in my next post.

    I have also tried tying "DS" (or "SER" in the datasheet) high, while putting a 5V pulse on "SHC" (or "SRCLK" in the datasheet), and tying "MR" (or "SRCLR") high and low, and tying also "STC" ("RCLK") high and low, and any combination of the above. I have never seen the tiniest blip of a voltage on any of the output pins.

     

    Last edit: Least Significant Bit 2018-09-09
  • Least Significant Bit

    Here's a more elaborate example, with a 0.5s 5V pulse applied to the "SHC" pin. With "DS" and "MR" tied high, I would expect this to clock in another "one" with every rising edge of the pulse, and with "OE" tied low these should appear on the outputs.

     
    • Santiago

      Santiago - 2018-09-09

      In 74HC595 you should use latch clock afther you shifted the bits you want, or just connect both clock inputs.

      In examples/logic you have some circuit ready to do some tests.

       
  • Least Significant Bit

    Thanks Santiago - I found the 74HC595 example, but whatever I do I cannot get any output! Maybe broken in trunk somehow? Also, I thought OE was inverted? In the example the switch feeds it 5V - does that mean it's tied to GND when "off"? I've tried with OE both on and off and still nothing...

     
    • Santiago

      Santiago - 2018-09-09

      Reset And Out Enable are inverted, so active low:

      Reset must be hight: inactive, not reseting.
      Out Enable must be low: active, enabled.

      Check this video: https://youtu.be/CXoIE4HMvcE

       
  • Least Significant Bit

    Doh! I knew that (reset must be high), just getting a bit tired. Example works now. Going back to my own test now to see if I can make it go - useuful to have a working example to compare behvaiour!

     
  • Least Significant Bit

    It's been a bit of a struggle, but seeing this makes me excited:

    I know the LED matrix needs drivers, but it's too fiddly to build these in SimulIDE; I tried adding a bunch of transistor driven mosfets but it slowed the simulation down to just 4% and with pull-ups etc it took up 5x as much screen space as the logic alone. Saying that, it's the AVR code I want to test, and SimulIDE is the only tool I know that will let me do this WYSIWYG and in "real time", so it's still quite useful!

     
  • Santiago

    Santiago - 2018-09-10

    Cool!

    Yes, Transistors can be slow, specially BJT, depending how you connect them.
    If you want to invert the signal to a Mosfet gate you could use an inverter (Buffer inverted), this way if should go way faster.
    Mosfets as switches at low speed should be fast.

    Glad to know it is useful.

     
  • Least Significant Bit

    No worries; I do not need to model the complete circuit, only the logic. I'm kinda new to Atmel C and trying to design a bi-colour LED matrix display, which to me is quite a challenge! I started by building a "proof of concept" in Python (with which I'm more famliar) and now need to port it to the AVR. I'm hoping SimulIDE will speed up the countless trial & error cycles which will be required. I have opted for a common row anode configuration, and row by row multiplexing; the low-side shift registers will be using the SPI port, with one burst of bytes per row, synced to the latching of the 74 599. I.e. "load up the column registers with row 1, latch out when row one is powered, repeat". Just easier for me to visualise what's going on that way.

    My proof of concept uses variable width fonts which are dynamically loaded from 1-bit PNGs and accepts a number of inline formatting commands. A fair few cycles will be spent on preparing a buffer update, but update speed is unimportant to me - I'm not interested in doing any kind of animation. The crucial thing is keeping the buffer output flowing smoothly regardless of what else the MCU is asked to do (there will also be a serial interrupt for incoming strings) - I have no idea if, or how, I can achieve this. My proof of concept (top is "actual" display, below that the red/green bits interleaved by 8, followed by the output bytes for each row):

    The screen redraw runs as a separate thread (only @ 10Hz, but then this is a text terminal, and not a SPI bus...), reading from a buffer which is updated in one chunk (128 bytes) by the string processing code, in turn triggered by a serial read. I'm hoping for a real world row rate of ~1kHz for a flicker free display, but unsure how to deal with the AVR being single threaded.

     

    Last edit: Least Significant Bit 2018-09-10
  • Santiago

    Santiago - 2018-09-11

    Very nice project.

    For that kind of perodic tasks i use this "library", it lets you set a timer and run periodic tasks in a multitasking-like way.

    Attached is an example blinking 3 leds, one toggles evry 500 mS, another 200 mS and last one every 100 uS.
    You can run some tasks inside interrupt routine, so they will execute periodically no matter what you are doing in main loop.

    Btw... how do you create those nice gifs?

    Regards.

     

    Last edit: Santiago 2018-09-11
  • Least Significant Bit

    Cool, that's a really useful example - thank you! Was looking at some "blink without delay" examples but this is cleaner and clearer. 10kHz is plenty fast.

    The gifs are made with Byzanz; a command line GIF screen recorder that does a really good job with optimisation. I usually grab whole screen and crop in Gimp, but you can specify a region too.

    Edit: What is this GCBasic - looks like C?

     

    Last edit: Least Significant Bit 2018-09-11
  • Santiago

    Santiago - 2018-09-11

    Gcbasic is an open sorce Basic compiler for pic and avr: http://gcbasic.sourceforge.net/
    I like the assembler it generates, totally human readable, and keeps variable and function names.

    Didn't know Byzanz, and it is in Ubuntu repositories! Thanks.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.