Page 1 of 1

Emulator ds1990 in pic16lf1503

Posted: Tue May 22, 2018 10:12 am
by leha_m1986
Hello!
Please help to organize the emulation ds1990. The compiler produces an error:

dallas.c: FCD_0bbd1_One_Wire1__Get_Next_ID()
615: break;
^ (345) unreachable code (warning)
dallas.c: 120: (1250) could not find space (64 bytes) for variable _FCV_0bbd1_One_Wire1__DEV_ID

Re: Emulator ds1990 in pic16lf1503

Posted: Tue May 22, 2018 7:28 pm
by medelec35
Unreachable code is not an issue as it's usually part of a C case statement.
A case statement is like the switch component (one icon below the decision icon)
The issue you have is
leha_m1986 wrote:could not find space (64 bytes) for variable _FCV_0bbd1_One_Wire1__DEV_ID
That just means the code is too big for target device.
So you either need to trim your code i.e. make it more efficient Or change to a bigger target device.


Martin

Re: Emulator ds1990 in pic16lf1503

Posted: Tue May 22, 2018 8:05 pm
by leha_m1986
There is one byte - device ID, 6 byte code and one byte CRC (01 00000D1042BE 6B) Do I need to use "transmite byte"? and transmit one at a time? if you edit the macro One_wire in flowcode5 (replace
DevID [64] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0.0.0.0.0,0.0.0.0,0.0.0.0.0,0.0.0,0.0.0.0.0,0.0.0
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0,0.0.0.0.0.0};
on
DevID [1] = {0}; )

with this macro code is placed. But in flowcode7 macros are edited.
How can I be in this situation?
Thank you in advance!