Hello Jan,
Have you changed the clock speed setting in the Flowcode project options to be 8000000?
One Wire Example - Failure on linking
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: One Wire Example - Failure on linking
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: One Wire Example - Failure on linking
Hello Ben,
I expeceted an automactic synchronisation. But setting the Flowcode option to 8 Mhz, the blinking test program is now working well with the internal clock. The 1-wire program, with 8 MHz internal clock, improved in a way that no bus error is detected anymore. But the temperature reading gives only the deflaut value of 85 oC. In contrast, using the external oscillator (19.6608 MHz) gives the correct temperature, which is nice today, 25 oC. There must be a (small?) deviation when using the internal clock. Do you have suggestions for improvement?
Kind regards
Jan Lichtenbelt
I expeceted an automactic synchronisation. But setting the Flowcode option to 8 Mhz, the blinking test program is now working well with the internal clock. The 1-wire program, with 8 MHz internal clock, improved in a way that no bus error is detected anymore. But the temperature reading gives only the deflaut value of 85 oC. In contrast, using the external oscillator (19.6608 MHz) gives the correct temperature, which is nice today, 25 oC. There must be a (small?) deviation when using the internal clock. Do you have suggestions for improvement?
Kind regards
Jan Lichtenbelt
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: One Wire Example - Failure on linking
I developed the 1-wire program, but I got an error which I do not understand. In the flowcode attached, I use an Init macro, which is called only once and shows 'WAIT' on the LCD. However not connecting any sensor should give the error message "No sensor". But what happens is that the program repeat starting all the time (which is shown by the counter in the Init macro showed after 'WAIT' on the first LCD line). Programmatically this should be impossible, but it happens nevertheless. What do I do wrong?
WHO CAN HELP????
Jan Lichtenbelt
As usual, I can not wait and started to find the error myself. The problem is an overflow of the char DevID[64] array of the 1-wire program, as used by e.g. by oo_scanbus. This means with no sensor attached, the number of device can become > 8. To prevent this kind of overflow I extended the oo_scanbus procedure as shown in the attached file. I strongly advice that this extra security line should become standard, when using the 1-wire flowcode.
WHO CAN HELP????
Jan Lichtenbelt
As usual, I can not wait and started to find the error myself. The problem is an overflow of the char DevID[64] array of the 1-wire program, as used by e.g. by oo_scanbus. This means with no sensor attached, the number of device can become > 8. To prevent this kind of overflow I extended the oo_scanbus procedure as shown in the attached file. I strongly advice that this extra security line should become standard, when using the 1-wire flowcode.
- Attachments
-
- FCD_One_Wire0_oo_scanbus.txt
- (829 Bytes) Downloaded 407 times
-
- test.fcf
- (26.46 KiB) Downloaded 454 times
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: One Wire Example - Failure on linking
Next problem.
I changed the 1-wire port from A0 to A1. A0 port is working correctly, while port A1 gives the error "NO SENSOR". The microcontroller used, is PIC 16F88. Does someone has experince is this problem?
I changed the 1-wire port from A0 to A1. A0 port is working correctly, while port A1 gives the error "NO SENSOR". The microcontroller used, is PIC 16F88. Does someone has experince is this problem?
Re: One Wire Example - Failure on linking
Jan,
Were you ever able to get this to work?
Regards,
George
Were you ever able to get this to work?
Regards,
George