sandy_r Posted February 9 Share Posted February 9 33 minutes ago, rwillett said: @nekomatic Sitting on my desk... "Desk"? - I see no desk! 😉 1 Quote Link to comment Share on other sites More sharing options...
rwillett Posted February 9 Author Share Posted February 9 6 minutes ago, sandy_r said: "Desk"? - I see no desk! 😉 That's a fair point. 1 Quote Link to comment Share on other sites More sharing options...
SamIAm Posted February 9 Share Posted February 9 On 29/01/2024 at 11:52, rwillett said: The moral of this story is "Dont mess with things that you think you understand but really don't, because it could be expensive and you literaly do get your fingers burnt". But where is the fun in that! LOVING this build! Sam x Quote Link to comment Share on other sites More sharing options...
rwillett Posted February 9 Author Share Posted February 9 1 hour ago, SamIAm said: But where is the fun in that! LOVING this build! Sam x I'm tired of playing with fire... and electricity greater than 0.1A and 5V... and circular saws that jump off the bed...and heat sinks that can melt lead...and toxic fumes from playing with ABS...and picking up hot metal from forges... I just about have 10 fingers and thumbs, though I look at them and I have knocked chunks off them and have had bits sewn back on. Rob 2 Quote Link to comment Share on other sites More sharing options...
Richard R Posted February 9 Share Posted February 9 9 minutes ago, rwillett said: and circular saws that jump off the bed... 😲 Isn't that dangerous? What if the duvet gets caught in the saw??? 2 Quote Link to comment Share on other sites More sharing options...
rwillett Posted February 9 Author Share Posted February 9 36 minutes ago, Richard R said: 😲 Isn't that dangerous? What if the duvet gets caught in the saw??? That's exactly my point as to why I shouldn't be let near power tools. 1 Quote Link to comment Share on other sites More sharing options...
nekomatic Posted February 9 Share Posted February 9 4 hours ago, rwillett said: Equipment I have, time to write a comms protocol to exchange information to drive a separate LCD display on a different Arduino, not so much. That's a fair point, as making a design change inevitably results in unexpected further difficulties, time and effort. Unfortunately in my experience, so does keeping the design the same… Quote Link to comment Share on other sites More sharing options...
SamIAm Posted February 9 Share Posted February 9 On 29/01/2024 at 13:12, rwillett said: As an aside the company I worked for as a sandwich student (do they still exist?), brought something like the 2nd Apple Lisa in the UK when it came out. I worked doing research in formal methods and the dept next door had the Lisa. OMG, just spotted this blast from the past. During my first degree (Attempt, 3 years in medical school learned me that I did not want to study medicine!) in '82, I was very involved in the computer club, eventually the Head of School IT chap gave me a key to his office and I spent many enjoyable hours on the Apple Lisa in there ... dial up acoustic coupler to this and that and some dev tinkering. Sam x Quote Link to comment Share on other sites More sharing options...
3below Posted February 9 Share Posted February 9 An Apple Lisa appeared in my Physics dept during my degree, 1981 ish? A long time ago. Happy days. 1 Quote Link to comment Share on other sites More sharing options...
rwillett Posted February 17 Author Share Posted February 17 After spending a number of evenings trying to get two Arduinos to talk reliably to each other through serial comms, I have given up. I can get them talking but no matter what I try, I cannot make it work reliably. I keep getting spurious characters. I suspect there is a timing issue that I simply don't understand. It's embarrassing to keep hitting my head on the table in front of the kids as I weep trying to get serial comms to work. So I'm changing my approach. I'm going to work out the i2c protocol and use that instead. I2C is packet based (32 byte messages) and looks significantly simpler, once you understand it (key point). The advantages of i2c is that it is a master/slace relationship using unique addresses for devices. The new approach will be: The Arduino Nano will be the master. This may become an Uno if I need a few extra IO pins. Its going to be tight but an Uno is no big problem. The Arduino Mega will be one slave. The 4x4 keyboard and LCD display will move from the Mega to the Uno. This simplifies comms. My original intention was to make the Uno a display only device and all the display commands would come from the Mega. The Mega may get replaced by a simpler Uno as the additional pins on the Mega are not needed now the display and keypad have moved to the Nano or Uno The Mega and LCD will be slaves on the I2C bus but this still allows bidrectional communication. to the master Nano. (Kinky) The software design now has all the LCD and keypad handling on the Nano. The Mega just does motors. The Nano master will simply send motor commands to the Mega slave in a fire and forget approach. The Mega slave will the count of motor step updates back to the Nano master every second or so via the I2C bus. The Nano will simply update as needed. The Nano master will write state into the 512Byte (512 BYTES!!!) so it remembers state after being turned off. Most of the code will continue to be used, especially all the motor code. I will refactor the keyboard and LCD code to work on the Nano and use the I2C to interface it all. Lets see how this goes.... Rob 1 1 Quote Link to comment Share on other sites More sharing options...
sandy_r Posted February 17 Share Posted February 17 10 hours ago, rwillett said: So I'm changing my approach. I'm going to work out the i2c protocol and use that instead ...one day Rob when you're retired and a grumpy old git, believe me, you'll look back on all your endeavours, and think: "Is it nearly beer o'clock?" ...did you visit the MODBUS rabbit-hole yet? Quote Link to comment Share on other sites More sharing options...
rwillett Posted February 17 Author Share Posted February 17 What makes you think I'm not a grumpy old git now? Modbus is too professional for a hack like me. 1 1 Quote Link to comment Share on other sites More sharing options...
rwillett Posted February 17 Author Share Posted February 17 And for those of you who remembered when memory was expensive and we really, really, really had to save memory This is the output of one of the sketches for the Arduino. This is for an Uno which has 32KB of program space (where the executable resides) and 2K (Two f%^&*@£ing KiloBytes of memory) I have washing machines with more space. I have ball point pens with more capacity than this. My sodding cat flap has more storage space than 2KB. I suspect the dogs glow in the dark collar has more than this. I've spent athe last two hours writing string arrays to sit in readonly mode to get more space for local storage and the stack. 2KB of local variable space <shakes head and goes and opens another bottle of wine> Kids today, don't know they are born. Sketch uses 3120 bytes (9%) of program storage space. Maximum is 32256 bytes. Global variables use 368 bytes (17%) of dynamic memory, leaving 1680 bytes for local variables. Maximum is 2048 bytes. 2 Quote Link to comment Share on other sites More sharing options...
Richard R Posted February 17 Share Posted February 17 (edited) I feel your pain, I do think modern programming is so much quicker than all the low level stuff I remember. Started programming on a ZX81, so yes I remember when memory was tight, men were real men, programmers were real programmers and small furry creatures from Alpha Centuri were real small furry creatures from Alpha Centuri. Edited February 17 by Richard R 2 3 Quote Link to comment Share on other sites More sharing options...
SamIAm Posted February 17 Share Posted February 17 (edited) I enjoyed my ZX81 (Damn that wobbly RAM extension!), but played with the Comodore PET and Tandy TRS-80 and Superbrain before. I LOVED the instruction set of the Z80! sam x Edited February 17 by SamIAm Quote Link to comment Share on other sites More sharing options...
rwillett Posted February 17 Author Share Posted February 17 1 hour ago, SamIAm said: I enjoyed my ZX81 (Damn that wobbly RAM extension!), but played with the Comodore PET and Tandy TRS-80 and Superbrain before. I LOVED the instruction set of the Z80! sam x I remember the wobbly ZX81 RAM pack. 8KB and 16KB? Didn't the ZX81 turn the display off for certain instructions as it couldn't refresh the screen display and execute the code at the same time? Was it 1Mhz or something? perhaps it was 4Khz Kids today don't know they are born. Rob 1 Quote Link to comment Share on other sites More sharing options...
SamIAm Posted February 18 Share Posted February 18 1 Quote Link to comment Share on other sites More sharing options...
tauzero Posted February 18 Share Posted February 18 There's something else you could try - driving the LCD direct from the Arduino rather than through the I2C adaptor. More fiddly but it may be the I2C bus that's slowing it down. https://docs.arduino.cc/learn/electronics/lcd-displays/ Also, junk the Uno and use an ESP32. Smaller, cheaper, and you have wireless and bluetooth built in if you want to use them. 1 Quote Link to comment Share on other sites More sharing options...
rwillett Posted February 18 Author Share Posted February 18 It looks like the LCD itself is sloooooooow. The i2c bus works at 100K. It's not much faster than a decent modem but it's enough. The timings for changing the LCD Display are quite large, I didn't realise TBH but I am where I am. I've just got the i2c packet stuff working now. Just sending down "Hello World" from the Uno to the Mega and it's a lot more reliable and simpler. Wire.beginTransmission(1); Wire.write("Hello World 2"); Wire.endTransmission(); I'm getting 13 bytes every time which is more than I did with the serial comms. It's non-blocking as well (AFAIK), so it looks OK. Now I need to get bidirectional comms, initially an ACK and then some more informative stuff. I have Arduinos around me and shields and I've just spent a few weeks learning more about how they work. No idea about the ESP32 so will stay on these as it looks a lot more promising, I'll work with a 2K variable limit. Will force me to be creative and selective. Rob 1 Quote Link to comment Share on other sites More sharing options...
Richard R Posted February 18 Share Posted February 18 1 hour ago, rwillett said: creative and selective An excellent moto for bass players, as well as for programmers. 1 Quote Link to comment Share on other sites More sharing options...
tauzero Posted February 20 Share Posted February 20 On 18/02/2024 at 14:50, rwillett said: I have Arduinos around me and shields and I've just spent a few weeks learning more about how they work. No idea about the ESP32 so will stay on these as it looks a lot more promising, I'll work with a 2K variable limit. Will force me to be creative and selective. You can program an ESP32 using the Arduino IDE, although it doesn't use Arduino shields. Quote Link to comment Share on other sites More sharing options...
rwillett Posted February 20 Author Share Posted February 20 I did read more up about it and I found that out. I have 4-5 Arduinos anyway, so will keep using them, the 2K limit is a challenge but I can make it work. The ESP32 doesn't seem to have quite such a large eco system around it, thought it does look very capable. Perhaps V2 1 Quote Link to comment Share on other sites More sharing options...
SamIAm Posted February 20 Share Posted February 20 ESP FTW! Sam x Quote Link to comment Share on other sites More sharing options...
rwillett Posted February 20 Author Share Posted February 20 What is this FTW of which you speak? Fitness To Work? For The Win? F**k The World? Forever Two Wheels? Free the Whales? Free To Watch? Feel The Wind? For The Will? Fight To Win? Finding The Way? Feed The World? For Those Wondering? Ford Truck World? Forschungszentrum Telekommunikation Wien? Fear The Wire? Free Trade Wharf? Florida Tax Watch? 4 Quote Link to comment Share on other sites More sharing options...
Aidan63 Posted February 20 Share Posted February 20 For the win(e) [hic] 😉 1 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.