Jump to content

Felm

Members
  • Posts

    58
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I'm not using the 595s for 7segments, the MAX7219 handle those. I used the 595s for some indicator leds (gun read, master caution etc) but you can easily substitute a MAX7219 in there, the principle is exactly the same!
  2. yeah I got them from china. It says maxim on them but they are probably fakes. I'll try new ones but I dont have high hopes for that fix since they work fine when it's only one that is processing data from dcs. Then I'll try unchaining them, maybe it's a signal propagation thing although it doesn't feel like one...hell it could even be the ledcontrol library that doesnt play nice with dcsbios. once I have them unchained I'll also try one 7219 per arduino, it seems my best bet right now since you can run 2 of them on separate boards with no issue I put decoupling caps on all the chips I use so it's not that unfortunately Totally agree with the pricing thing, if I had to buy all my stuff from European retailers I'd probably never have gotten in to electronics in the first place. On the other hand some stuff is worth paying more for better quality, especially tools etc. Digikey and mouser do have good prices though, pity the shipping kills it if you are not in the US
  3. Hmm, interesting. Are the max7219 you are using for the ILS and UHF repeater chained together? Or each one goes to a separate pro mini? My 3 max7219 are chained together, maybe that has something to do with the issue?
  4. nope, no luck when using separate arduinos. Now I can't even get two dislays to work properly, only one ! Warhog I've seen that you are also using max7219 with 7segs for radios, how is that working out for you? same issues? EDIT: did some more testing. one max7219 with 6 digits on a mega and 3 74hc595 with 24leds (not all of them in use, not even close) on the UNO seems to work fine. If I add the 74hc165 chain to the UNO then the leds lag and skip. the max7219 works fine and there's no delay between turning a rotary encoder (connected to the 74hc165) and seeing the output change on the 7 seg. If I connect the max7219 (only one enabled, 6 digits) and 74hc595 leds to the mega and the 74hc165 to the uno, everything seems to work fine. I tried to see if the led I have set as master caution syncs with the one in game, it seems a tiny bit behind/off sync but that might just be me. Not an issue at all at this point. Not so sure what to do now....
  5. Thanks for the replies guys. Yeah all of that is connected to a single UNO. I'll try using more arduinos in a bit to see if it solves the issue. I have two megas sitting around unused. To be honest it was fun building the circuits and coding but I'm getting a bit burned out with the project right now. If I just need to use more boards I'll order some pro-minis from aliexpress and be done with it. It defies the point of working on all those shift registers and circuitry/code but hey, whatever works !
  6. Hey guys, I'm almost done with the code and circuit but I've stumbled on an issue. Remember the problems that were solved by lowering the baud rate to 115k? I'm encountering them again even with 115k baud. It seems as if I am overloading the transfer of output data. Changing the baud rate or in game speed or just the amount of data exported by turning avionics off in-game has a direct effect on my leds and 7segment displays. Physically turning off the displays or the leds also has an impact, as in the less stuff I have connected the better it works. For example just two MAX7219 (total of 12 digits) works fine. 3 chips (18 digits) does not. But the two MAX that worked fine by themselves will get all weird if I turn the individual leds on (gun ready, cockpit open etc etc). Inputs seem unaffected. I will post the code but it's big and clumsy if someone wants to take a look. I can break it down in smaller chunks tomorrow. Here is code http://pastebin.com/FXgd5Kut There's bound to be mistakes in the commenting, it's not done yet.
  7. i had no problems with 1k but it's been a while and my panel is disassembled right now. Ill see if I can reproduce your issue if I get some time.
  8. shift register code is done using multiple 64bit variables for the shift in, 8 chips at a time. I took a look on how to perform bitshift operations on >64bit but my brain melted a bit so I gave up. Will sanitize and document the code by the end of the weekend hopefully.
  9. I don't know about I2C limitations but I don't think you will have power issues if you are only doing inputs (the only draw will be the arduinos themselves which you will have to calculate). If you need more inputs you can get port expanders or shift registers. However depending on your needs it might just be cheaper to get more boards. You will have to calculate the costs of expanders/ shift registers vs boards (there's also the other costs of building the circuit around the shift registers or expanders).
  10. You can also look at aliexpress. I usually compare prices between ebay/ali and get what's cheaper or higher rated etc. For example you can get 10 minis for around 1.65usd each. free shipping for my country, if it's not for you then search again and tick the free ship button I haven't ordered this so I can't vouch for it but it's the most ordered (I usually sort by "orders" but look around, there might be cheaper offers that are not the most ordered but still from legit sellers). Don't forget that it's new year over there so everything slows down to a crawl...might be a while till you get your stuff, depending on your luck
  11. hey guys sorry for not posting any updates, didnt havetime to work on stuff this week. Ill try to do it tomorrow. I haven't tried to get rotary encoders working with the shift registers yet but I stumbled on a few posts here and there where people said it's not a good idea...not really explained why. Anyone have any opinions on this? ED: I reread the posts I found and if I understood correctly it was about the potential of missing inputs from the encoders. I might be wrong but for our purposes this is surely annoying but not catastrophic, right? I guess this would be a serious issue for something like a motor or a CNC-style application.
  12. that's awesome goodnight, great job! things are coming along nicely on my end as well. code for chained 74hc165 is done (no extern global variables). I tested it with 4 chips, i'll try with 8+ today to see if theres any issues. then i'll do chained max7219s and then give a shot to the cd4051 multiplexers for analog inputs.
  13. useful things these pointers :doh: http://pastebin.com/6YCdVsmm this works for me with no extern variables and 3 linked 595s. thanks for the reminder to use pointers Gadrock EDIT: remember to change baud rate
  14. Thanks to both of you for all the info, I am learning so much this is great! Ah, the elusive "MetadataEnd" module...second time I forgot to change from the a10c module. Gadroc, I've been bashing my head on the keyboard since your last post trying to avoid a global variable but I'm a bit stuck. I can't see how to avoid using one since the bitSet happens in the .cpp file but the shiftout happens in the .ino sketch. How can the .ino know that the variable it's supposed to shift out has had its bits set in the .cpp file without using a global variable? I've tried googling for it but everything points to using extern variables. :helpsmilie: Here is some very raw code //****************.CPP FILE********************* LEDSR2::LEDSR2(unsigned int address, unsigned int mask, char pin, unsigned int SRleds) { address_ = address; mask_ = mask; pin_ = pin; SRleds_ = SRleds; } void LEDSR2::onDcsBiosWrite(unsigned int address, unsigned int value) { if (address_ == address) { if (value & mask_) { bitSet(SRleds_, pin_); // THIS GUY DOESNT GET SHIFTED OUT!!!!?? } else { bitClear(SRleds_, pin_); // THIS GUY DOESNT GET SHIFTED OUT!!!!?? } } } //*******************.H FILE************* class LEDSR2 : ExportStreamListener { private: void onDcsBiosWrite(unsigned int address, unsigned int value); unsigned char pin_; unsigned int address_; unsigned int mask_; unsigned int SRleds_; public: LEDSR2(unsigned int address, unsigned int mask, char pin, unsigned int SRleds); }; //**********************.INO SKETCH*********** [...] unsigned int leds =0; DcsBios::LEDSR2 masterCaution(0x1012, 0x0800, 2, leds); [...] void onDcsBiosWrite(unsigned int address, unsigned int value) { if (address == 0xfffe) { updateShiftRegister(); } } void updateShiftRegister() { digitalWrite(latchPin, LOW); shiftOut(dataPin, clockPin, MSBFIRST, leds); // "leds" HAS NOT HAD ITS BITS SET ??? digitalWrite(latchPin, HIGH); } wat do? put the class in the ino file?
×
×
  • Create New...