mozzwald Posted November 14, 2019 Share Posted November 14, 2019 6 hours ago, Dropcheck said: Is the MSK12C02 of some special design, or just what was in the parts bin? I'm not finding that part # on either Mouser or Digikey. Any SPDT on/off switch will work. It's just a commonly used on/off mini slide switch in small devices, and I have some. Link to comment Share on other sites More sharing options...
AtariGeezer Posted November 14, 2019 Share Posted November 14, 2019 20 hours ago, mozzwald said: The biggest change to hardware is the fact that we no longer need the level shifter as the esp8266 is 5V *LOGIC* tolerant. The GPIO pins can handle voltages up to 5V, but the device must be powered with 3.3V still. Hmmm, I guess it is: esp8266-is-5v-tolerant-after-all Link to comment Share on other sites More sharing options...
tschak909 Posted November 14, 2019 Author Share Posted November 14, 2019 Yes, it is. 8266 chip designer weighed in on the matter. Basically the data pins can handle 5v, but Vin MUST be 3.3V. This simplified our current iteration of the board drastically. -Thom Link to comment Share on other sites More sharing options...
Dropcheck Posted November 14, 2019 Share Posted November 14, 2019 1 hour ago, tschak909 said: Yes, it is. 8266 chip designer weighed in on the matter. Basically the data pins can handle 5v, but Vin MUST be 3.3V. This simplified our current iteration of the board drastically. -Thom So the diode in Mozzwald's latest schematic on the Vin pin is not only preventing the USB power from backing into SIO side, but is also reducing the SIO +5V to 3.3V? I suppose it could function as both, but I'd rather see a separate actual AMS1117 3.3V circuit as a separate voltage regulator just for NodeMCU safety's sake. Or does both the Vin and USB power go thorugh the onboard AMS1117? Link to comment Share on other sites More sharing options...
mozzwald Posted November 14, 2019 Share Posted November 14, 2019 13 minutes ago, Dropcheck said: So the diode in Mozzwald's latest schematic on the Vin pin is not only preventing the USB power from backing into SIO side, but is also reducing the SIO +5V to 3.3V? I suppose it could function as both, but I'd rather see a separate actual AMS1117 3.3V circuit as a separate voltage regulator just for NodeMCU safety's sake. Or does both the Vin and USB power go thorugh the onboard AMS1117? The diode only prevents SIO from getting 5V USB power. The Nodemcu board already has a voltage regulator to step down the the input voltage from 5V to 3.3V (from both Vin and USB). Link to comment Share on other sites More sharing options...
Dropcheck Posted November 14, 2019 Share Posted November 14, 2019 5 minutes ago, mozzwald said: The diode only prevents SIO from getting 5V USB power. The Nodemcu board already has a voltage regulator to step down the the input voltage from 5V to 3.3V (from both Vin and USB). ? Link to comment Share on other sites More sharing options...
a8isa1 Posted November 14, 2019 Share Posted November 14, 2019 2 hours ago, tschak909 said: Yes, it is. 8266 chip designer weighed in on the matter. Basically the data pins can handle 5v, but Vin MUST be 3.3V. This simplified our current iteration of the board drastically. -Thom quick question. well 2 actually. no 3! Are Proceed and Interrupt needed for test #6? Will the project work with GPIOs 1 and 3 if I use Serial.swap()? My test setup currently is hardwired for those pins. TNFS? I need pointing in the right direction. I've been world's longest running linux n00b! -SteveS Link to comment Share on other sites More sharing options...
tschak909 Posted November 14, 2019 Author Share Posted November 14, 2019 (edited) no, 7 minutes ago, a8isa1 said: quick question. well 2 actually. no 3! Are Proceed and Interrupt needed for test #6? Will the project work with GPIOs 1 and 3 if I use Serial.swap()? My test setup currently is hardwired for those pins. TNFS? I need pointing in the right direction. I've been world's longest running linux n00b! -SteveS No it isn't. PROCEED and INTERRUPT aren't used, yet. TNFS is a file server that was designed for the Spectranet project. It shares a directory of files over a simple UDP protocol, and can be acquired here: http://spectrum.alioth.net/doc/index.php/TNFS_server It only has one parameter, the directory to share. Test #6 does not use TNFS, Test #7 does. as for pins, the source code has #defines for specifying the individual pins. you absolutely need the command pin. (If this sounds a bit strange, please understand, I am not developing the firmware in one big blob. I am deliberately developing little mini-firmwares to develop and test individual features.) -Thom Edited November 14, 2019 by tschak909 2 Link to comment Share on other sites More sharing options...
mozzwald Posted November 14, 2019 Share Posted November 14, 2019 31 minutes ago, a8isa1 said: Will the project work with GPIOs 1 and 3 if I use Serial.swap()? My test setup currently is hardwired for those pins. You can use GPIO 1 & 3 for TX/RX but, make sure the nodemcu is powered up before turning on the atari and you will need to comment out/remove the Serial.swap() line from the sketch. 1 Link to comment Share on other sites More sharing options...
tschak909 Posted November 15, 2019 Author Share Posted November 15, 2019 Can someone explain what stupid thing I am doing here to cause the system to freeze, rather than do a raspberry? /** * #AtariWiFi test program #8 * * Display Network Info * * Author: * Thomas Cherryhomes * <thom.cherryhomes@gmail.com> * */ #include <atari.h> #include <6502.h> #include <stdio.h> /** * The Netinfo structure to make it easy. * * ssid = the currently connected access point * bssid = the MAC address of the access point (in little endian order) * ipAddress = the IP address of the adapter (in little endian order) * macAddress = the MAC address of the adapter (in little endian order) * rssi = The calculated signal strength in dBm. */ typedef union _netinfo { struct { unsigned char ssid[32]; unsigned char bssid[6]; unsigned char ipAddress[4]; unsigned char macAddress[6]; unsigned long rssi; unsigned char reserved[12]; }; unsigned char rawData[64]; } NetInfo; /** * Function to retrieve network info from adapter. * * Params: A pointer to a NetInfo struct. * Returns: Status (1 on success, otherwise error.) * Filled in NetInfo struct on success. */ unsigned char sio_get_network_info(NetInfo* ni) { struct regs r; OS.dcb.ddevic=0x70; // Network control device OS.dcb.dunit=0; // unit 1 OS.dcb.dcomnd='!'; // Get network info command OS.dcb.dbuf=ni->rawData; // Pointer to netinfo buffer OS.dcb.dtimlo=0x0f; // 16 frame timeout OS.dcb.dstats=0x40; // This is a read. OS.dcb.dbyt=64; // 64 bytes of data OS.dcb.daux=0; // no aux for now. // $E459 = SIOV r.pc=0xE459; _sys(&r); return OS.dcb.dstats; } void print_network_info(NetInfo* ni) { printf("SSID: %s\n",ni->ssid); printf("BSSID: %02x:%02x:%02x:%02x:%02x:%02x\n", ni->bssid[5], ni->bssid[4], ni->bssid[3], ni->bssid[2], ni->bssid[1], ni->bssid[0]); printf("IP: %u.%u.%u.%u\n",ni->ipAddress[3],ni->ipAddress[2],ni->ipAddress[1],ni->ipAddress[0]); printf("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", ni->macAddress[5], ni->macAddress[4], ni->macAddress[3], ni->macAddress[2], ni->macAddress[1], ni->macAddress[0]); printf("RSSI: %ld",ni->rssi); printf("\n\n"); } void main(void) { NetInfo ni; unsigned char error; printf("#AtariWiFi Test Program #8\n"); printf("Get Network Information.\n"); printf("\n\n"); printf("Reading..."); error=sio_get_network_info(&ni); if (error==138) { printf("Timeout!\n"); } else if (error==1) { printf("Success!\n"); print_network_info(&ni); } else { printf("Error #%d",error); } printf("Program done. "); for (;;) { } // spin. } Binary attached. -Thom netinfo.com Link to comment Share on other sites More sharing options...
tschak909 Posted November 15, 2019 Author Share Posted November 15, 2019 ok, turns out calling CC65's stdio routines after issuing an SIOV call is a _very_ bad idea, it doesn't completely crash, but it spins inside the SIOV waiting for a condition that never happens.... replacing it with conio calls fixed the problem, and the program now raspberry's correctly. I will see what happens with the new hardware that arrives tomorrow from @mozzwald. Link to comment Share on other sites More sharing options...
tschak909 Posted November 15, 2019 Author Share Posted November 15, 2019 #AtariWiFi Test Program #8 successful! This program shows that our custom SIO device is working and accepting commands, this one showing network information. And to further drive home the sheer flexibility, I did the program in both C and BASIC! 6 Link to comment Share on other sites More sharing options...
Lastic Posted November 15, 2019 Share Posted November 15, 2019 8 hours ago, tschak909 said: no, No it isn't. PROCEED and INTERRUPT aren't used, yet. TNFS is a file server that was designed for the Spectranet project. It shares a directory of files over a simple UDP protocol, and can be acquired here: http://spectrum.alioth.net/doc/index.php/TNFS_server It only has one parameter, the directory to share. Test #6 does not use TNFS, Test #7 does. as for pins, the source code has #defines for specifying the individual pins. you absolutely need the command pin. (If this sounds a bit strange, please understand, I am not developing the firmware in one big blob. I am deliberately developing little mini-firmwares to develop and test individual features.) -Thom And that Sir is brilliant because with all the discussions regarding SIO2WiFi before, I was always pondering wether NFS would be an option but I know that is a heavy network protocol for our 8 bit machines https://en.wikipedia.org/wiki/Network_File_System Never knew the Spectrum guys would have made a lightweight version until you proposed it. Link to comment Share on other sites More sharing options...
Lastic Posted November 15, 2019 Share Posted November 15, 2019 @tschak909 my apologies upfront for the many questions ! I will wire my NodeMCU today and give it a spin with test 7 and 8. If I understand correctly each test is a seperate INO file that needs to be flashed to the NodeMCU via Arduino IDE (or similar tools) ? There is no basic setup needed on the NodeMCU ? The test 8 program in C , you used cc65 for that , correct ? Just asking because even that is has been 24 years ago since I touched C , I was suprised at how I could look at the code and get the gist of it. Link to comment Share on other sites More sharing options...
a8isa1 Posted November 15, 2019 Share Posted November 15, 2019 14 hours ago, mozzwald said: You can use GPIO 1 & 3 for TX/RX but, make sure the nodemcu is powered up before turning on the atari and you will need to comment out/remove the Serial.swap() line from the sketch. Yep. I found it after I found the correct sketch I'm not having success. I don't understand what I'm seeing. I get this output from tnfsd (64-bit linux daemon) 192.168.1.221 is the address for my Nodemcu devboard If I use the USB cable this is what is appearing (at 19200 bps) Are there any special settings in the Arduino IDE that I need to make? -SteveS Link to comment Share on other sites More sharing options...
tschak909 Posted November 15, 2019 Author Share Posted November 15, 2019 not sure what's happening there -Thom Link to comment Share on other sites More sharing options...
a8isa1 Posted November 15, 2019 Share Posted November 15, 2019 55 minutes ago, a8isa1 said: Yep. I found it after I found the correct sketch I'm not having success. I don't understand what I'm seeing. I get this output from tnfsd (64-bit linux daemon) 192.168.1.221 is the address for my Nodemcu devboard If I use the USB cable this is what is appearing (at 19200 bps) Are there any special settings in the Arduino IDE that I need to make? -SteveS Problem solved! Karateka booted! We have WiFi! I made this change to test #7 sketch. void ICACHE_RAM_ATTR sio_isr_cmd() -SteveS Link to comment Share on other sites More sharing options...
tschak909 Posted November 15, 2019 Author Share Posted November 15, 2019 ok so you actually NEEDED that. What board are you using? Also, isn't it just utterly bizarre that we're booting Atari's over the network now? -Thom 1 Link to comment Share on other sites More sharing options...
tschak909 Posted November 15, 2019 Author Share Posted November 15, 2019 Ok, the upstream code has been altered to add this change. -Thom Link to comment Share on other sites More sharing options...
a8isa1 Posted November 15, 2019 Share Posted November 15, 2019 (edited) 14 minutes ago, tschak909 said: ok so you actually NEEDED that. What board are you using? Also, isn't it just utterly bizarre that we're booting Atari's over the network now? -Thom Yep. Needed it. I'm using an older v0.9 NodeMCU dev board with 4MB of flash memory. The PCB is the size that was annoying for people with small breadboards. It's not bizarre only anticipated for a long, long time. Thanks to you and mozzwald for getting the ball rolling. Not to forget Espresif and Arduino IDE people. The hardware and the tool chains are amazing. -SteveS Edited November 15, 2019 by a8isa1 2 1 Link to comment Share on other sites More sharing options...
tschak909 Posted November 15, 2019 Author Share Posted November 15, 2019 aren't they? btw, this is the board we are currently using, so damned cheap that Amazon is selling two-fers https://www.amazon.com/gp/product/B06X8ZJG87 And the adapter board looks like this: 2 Link to comment Share on other sites More sharing options...
tschak909 Posted November 15, 2019 Author Share Posted November 15, 2019 and with the NodeMCU 1.0 fitted: -Thom 3 Link to comment Share on other sites More sharing options...
tschak909 Posted November 15, 2019 Author Share Posted November 15, 2019 10 hours ago, Lastic said: @tschak909 my apologies upfront for the many questions ! I will wire my NodeMCU today and give it a spin with test 7 and 8. If I understand correctly each test is a seperate INO file that needs to be flashed to the NodeMCU via Arduino IDE (or similar tools) ? There is no basic setup needed on the NodeMCU ? The test 8 program in C , you used cc65 for that , correct ? Just asking because even that is has been 24 years ago since I touched C , I was suprised at how I could look at the code and get the gist of it. No apologies necessary, questions denote genuine interest. I bend over backwards for genuine interest. Yes, each test program is a seperate Arduino sketch. This is so that individual features can be worked out and tested before I actually try to write a production firmware. The purpose of each test is to produce the minimal amount of code (which might or might not have error checking) to test the feasibility of a given wanted feature. The manual: https://docs.google.com/document/d/1dIKFuxmX9O9cckz0HLN_7GmDKrYcbHury7Mgoomzqtg/edit# gives some detail on the setup we are using, and how to set things up, currently we are using one additional tool, the ESP8266 Sketch Data Uploader (link in manual) to upload any data that we want on the SPIFFS flash storage. And yes, for test 8, I quickly coded the atari side in cc65, because I've done quite a bit in that, but anything can be used. If you see, it's just SIO calls, and that will literally be the bulk of what it takes to communicate with the adapter. As to the feasibility of this for certain things, we'll see, but this is why I've taken the extra effort to go in this direction, instead of just doing yet another R:Verter device. 2 1 Link to comment Share on other sites More sharing options...
Lastic Posted November 15, 2019 Share Posted November 15, 2019 Currently trying to do TNFS on LAN , I can see that the ESP gets an IP address via DHCP and I see a log in the TNFSD window Cli: 192.168.1.251 Session: 0 : Freeing existing session but only if I connect the NodeMCU via USB only to my laptop. The serial monitor in the Arduino IDE also doesn't work for me when uploading the INO file, at any baudrate it just spits out gibberish and there is a Java error in the bottom error messages screen whenever I change my baudrate. Connected to my 800XE, nothing happens, no DHCP, no TNFS logging, with or without option. Any clues what I'm doing wrong ? Should I maybe try power the NodeMCU only via USB (so no Vin connected to the 800XE) whilst making all the other connections to the SIO on 800XE ? Link to comment Share on other sites More sharing options...
tschak909 Posted November 15, 2019 Author Share Posted November 15, 2019 power via the USB. Also be sure to get the latest version of the code, as I made a change for a8isa and his NodeMCU 0.9 board. -Thom Link to comment Share on other sites More sharing options...
Recommended Posts