1 wire problem
Jon87
Posts: 14
Hi, I've got a problem with initializing objects in my program.
The problem is that if i initialize them in my start method, the 1 wire comms will not work correctly but if i initialize them in my main method, it works fine.
Does anyone know what might be causing this?
Thanks
The problem is that if i initialize them in my start method, the 1 wire comms will not work correctly but if i initialize them in my main method, it works fine.
Does anyone know what might be causing this?
Thanks
OBJ text : "tv_text" ow : "SpinOneWire" PUB start 'text.start(12) 'ow.start(3) main PUB main | i, numDevices, addr1 text.start(12) ow.start(3) text.out($00) ....... .......etc
Comments
Not really. What happens if you give start some local variables (like main), just to see if perhaps some code is accessing the stack in a buggy manner.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
I'm currently working on a project which is using a few objects for reading IR codes, serial comms, keyboard input, reading and writing to eeprom and tv text. The only part that wont work is the 1 wire comms. I beleive it may have somehting to do with the direction change of the pin (input/output) throughout comms. I might try a different 1 wire comms object which uses a seperate cog to see if that helps
Another question. how long does it take to stop or start a cog?
That should be in the order of 512 * 16 cycles + some more IIRC. 16 cycles is the hub window and there are 512 longs to be copied or initialized to zero. Someone else may know better.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects
Thanks, as long as it's faster than the human eye can see it should be fine for my project.
The program is working fine now in PASM