so i have gotten my liquidcrystal working, and have the shift register working.
now i’m trying to combine the both.
i have used this tutotial : http://playground.arduino.cc/Main/LiquidCrystal#ExtraPins to wire the setup up, nut now i’m stuck at translating this into a new firmware sketch…
i need to replace the digital ports currently defined in my liquidcrystal sketch, by the ports from the shiftregister. i have no freaking clue how to do this… any suggestions?
Support for multiple files in the IDE will be added soon. In the meantime, you can selectively copy and paste the content from the LiquidCrystal.h and LiquidCrystal.cpp files into the IDE in addition to your code, and simply change the pin numbers as necessary.
If you run into any issues as you attempt this, post them here and your combined code so far and we can help you work through it.
first of all, you rock!
i’ve copied the code, but for the love of me, i can’t find where to define my shift register pins? nor can i find where to define to which shift register pin i’ve connected my display… am i that stupid?
thanks for your reply!
yes, i’ve wired the LCD like that, but i actually wired the shift register differently, i connected the DS to Digital 4, Clock Pin to Digital 5 and Storage to Digital 6…
so the difference is that in your diagram it is 13, 11, 10, in my setup it’s 4,5,6…
Yup! This is how you want to hook your 74HC595’s three lines to your Spark Core:
SPARK CORE SPI PINOUTS
Spark Core 74HC595
A5 (MOSI) 14 - The data bits (74HC595 pin 14 "DS").
A4 (MISO) NOT USED
A3 (SCK) 11 - The shift clock for the data bits (74HC595 pin 11 "SHCP").
A2 (SS) 12 - The strobe that copies the databits into the latch (74HC595 pin 12 "STCP").
im sorry, i think You misunderstood,
i tested the shift register with led’s on port d4,d5,d6, and that worden. SO then i hard wired everything To those 3 ports.
the question is, can we change the code do that islt uses those 3 digital ports instead of the 3 spi ports that You are refering To…
The default connections for SPI on the Spark Core are A2, A3, A4, A5 and they are hooked up to a hardware SPI peripheral inside the STM32 (at least I’m pretty sure it’s hardware). There is no way to redefine those pins from your application at the moment. The only other way you could do it is if you used the slow shiftOut() function.
But the library I converted takes advantage of the high speed SPI that the Core has, so if there is no strong reason to use D4, D5, D6… I would suggest using A2, A3, A5. Otherwise we can work on crippling the library to use shiftOut() which is supported by the Spark Core already, but I don’t think you’ll like how slow your LCD updates.
You can define multiple SS pins that act as the Latch for SPI devices. The default is A2, but you can define a second latch pin on any other digital output. The MOSI (data A5) and SCK (clock A3) for your second device can be paralleled together with the first device, but only the latch pin that is low will respond to the data and clock.
If using this library you could theoretically define a new instance like LiquidCrystal lcd2(D0); and set the SS pin to whatever you want, in this case D0.
so, progress… i guess.
rewired everything, reconnected the spark core, and now only the little blue LED (n ot the big one) is on. nothing else. c an’t even reset… nice.
@korneel could you please share a picture of your wiring?
Also do you know how to factory reset?
Try a factory reset. Hold down both buttons, then release the RST button, while holding down the MODE button. The LED should begin flashing yellow. Continue holding down the MODE button until you see the Core change from flashing yellow to flashing white. Then release the button. The Core should begin flashing blue after the factory reset is complete.
sory for thelate reply, i’m traveling for work for another week.
as far as my issues;
so i have to reset the spark core whenever i load this code.
even worse, after the factory reset, i am unable to use the USB and Windows method to reconnect to the spark cloud.
it happily blinks blue, i connect using serial, give it my wireless network name and wireless key, and it accepts it. reboots and hello, the blue blinky led is back and i still have to put in my wireless ssid and password…
i connected it back to the spark cloud, reflashed the firmware, and now the core is in a couple-white flash, couple green flash - blue led D7, no LED loop.
i think someone from the Spark friends should step up here and look at this with us,…
first of all, thanks @Dave for reporting in
let me be specific about the fact that @BDub is the resident genius here, without the library import i am essentially lost, but he has been making great progress!
@BDub, do you still need me to share the wiring?
i don’t think the problem is in the wiring, if i just upload the code to the core, even without any connection, the core just completely flips out…