Frozen Loop
info
Posts: 31
I tried to use obex code for Dallas 1-wire device discovery. I use i2c 1-wire master bridge, so I have to modify the code. Somehow I srewed it up and it freezes or refuses to repeat loop and I just can't figure out why. I inserted serial port strings between lines trying to figure out where does it fail. I have no clue. It comes to the end of loop and stops.
Comments
Your return statement returns right after first iteration - unindent it two levels so it's in line with "repeat i from 0 to 7" and not inside it.
Try:
electrodude
The maxAddrs loop should go around 4 times and fall through to the next code below to print the 8 bytes serial number. That part has to be changed to display the serial number after each loop. I just try to isolate all unnecessary code to fix the frozen loop problem.
After inserting printable string line after line, I found that "longmove" instruction crashed the loop execution. When I comment out the longmove line, the loop executes 4 times as it should.
I'm not a programmer and while I read the Propeller Manual, spin and also assembly instruction list, I don't understand lot of the memory access, the difference between "MyData", "@MyData", "MyData[x]", accessing cog memory and hub memory, or movig parameters from one to another, etc. To me it's kinda trial and error, but I still wonder why does "longmove" to declared VAR space crashes code when the code from obex most likely works when used as is.
I tried to write little hex memory dump loop to display few lines of hex dump - whatever fits the small Parallax Terminal window looking for declared VARiables. After few failures I have that work, then I read here somewhere that my variables are re-arranged by the Propeller Tool. I will play with that later because it helps me understand what the program is doing when I can see and verify it.
The original demo calls the search method like this: where addr is defined as: as required by the API.
That should hold 64 devices which is about the maximum considered serviceable by Dallas. I think the old Dallas book said something like up to 100 devices.
I'm still unable to put the "@rom" back to the VAR location. Whatever I tried so far crashed or didn't work. Also when I print "addrPtr" I get different values like if the Parallax Tool assigned different address to the VAR at every reload.