One Wire Example - Failure on linking

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

User avatar
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

Post by Benj »

Hello Jan,

Have you changed the clock speed setting in the Flowcode project options to be 8000000?

User avatar
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

Post by Jan Lichtenbelt »

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

User avatar
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

Post by Jan Lichtenbelt »

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.
Attachments
FCD_One_Wire0_oo_scanbus.txt
(829 Bytes) Downloaded 407 times
test.fcf
(26.46 KiB) Downloaded 454 times

User avatar
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

Post by Jan Lichtenbelt »

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?

gggwww
Posts: 54
Joined: Wed Sep 09, 2009 12:50 am
Has thanked: 1 time

Re: One Wire Example - Failure on linking

Post by gggwww »

Jan,

Were you ever able to get this to work?

Regards,
George

Post Reply