Solved i found a solution
One of your loops is taking too much time. Run the exception decoder to get a clue of where it was in the code when it happened.
Then you can fix your loop or add yield() as needed.
while-loops like this occupy 100% processor-power
and this makes the Watch-Dog bite
you could add yield() to these loops.
Your code looks like if you want to do SPI-bitbanging from scratch.
Why don't you use a SPI-library that is well know for working reliably?
Thank you for your answar, unfortunly i have no idea how to add that yield() or where to add it, is like 7 days i keep trying to fix it from what i understend the SPI-library is inclued i mean i have the #include <SPI.h>
sorry I made a type
you could add yield() to these loops.
instead of coding
byte CheckReceiveFlag(void)
{
if(digitalRead(GDO0)) //receive data
{
while (digitalRead(GDO0));
return 1;
}
else // no data
{
return 0;
}
}
add a yield();
byte CheckReceiveFlag(void)
{
if(digitalRead(GDO0)) //receive data
{
while (digitalRead(GDO0)) {
// give the processor enough time to do all the
// backround-stuff including "hugging" the watch-dog
yield();
}
return 1;
}
else // no data
{
return 0;
}
}
I have not coded anything with SPI
But why is this code messing with the SPI-Bus-io-pins on the user-code-level??
waiting for a particular SPI-bus-Pin to become LOW or HIGH should all be done
inside the SPI-library
There should be possabilities to read any kind of registers by function-calls to the SPI-library
edit the title of thread to
reading SPI-Bus-registers / Help me to avoid Soft WDT-reset through using function-calls
best regards Stefan
Thank you very much for your help, i really apreciate
I did try that it dosen't work i can not get it is gona make me crazy i think i get the same error CC1101_SS_PIN in pin 15
CC1101_GDO0_PIN in pin 5
Test lecture VERSION du CC1101
Init CC1101 OK
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Soft WDT reset
stack>>>
ctx: cont
sp: 3ffffdd0 end: 3fffffc0 offset: 01a0
3fffff70: 3fffdad0 00000000 3ffee515 402010d2
3fffff80: 3fffdad0 00000000 00000034 40201608
3fffff90: 3fffdad0 00000000 3ffee540 3ffee5a8
3fffffa0: 3fffdad0 00000000 3ffee594 40202630
3fffffb0: feefeffe feefeffe 3ffe85e0 40100c01
<<<stack<<<
what is "that"? what exactly do you observe what you say is "doesn't work" what is "it"
How many rounds of playing a PING-PONG-game with
too short to be informative postings
and
asking back
do you want to play?
You should add the yield() in every while-loop
If you can't deal with the exception decoder
then add serial debug-output right before each and every while-loop
In this way you can narrow down the problem to that line of code that causes the SWDT
If you have questions how to do any of this ask
specific questions
best regards Stefan
-You should add the yield() in every while-loop - This is what i try to find where can i identify all this while-loop, i also did try to install exception decoder but i'm on Ubuntu and i did't find any why to install it after tring 2 hours,
I have a ESP8266 attached to a CC1101 module, and the data from the CC1101 should be displayed in the serial monitor but i keep geting only this txt `--------------- CUT HERE FOR EXCEPTION DECODER ---------------
Soft WDT reset
stack>>>
ctx: cont
sp: 3ffffdd0 end: 3fffffc0 offset: 01a0
3fffff70: 3fffdad0 00000000 3ffee515 402010d2
3fffff80: 3fffdad0 00000000 00000034 40201608
3fffff90: 3fffdad0 00000000 3ffee540 3ffee5a8
3fffffa0: 3fffdad0 00000000 3ffee594 40202630
3fffffb0: feefeffe feefeffe 3ffe85e0 40100c01
<<<stack<<<
--------------- CUT HERE FOR EXCEPTION DECODER ---------------
⸮!⸮H⸮1)X⸮i⸮H⸮J1q8⸮"⸮K%SH⸮k⸮K 9X̟6⸮⸮⸮!@⸮ֈ)⸮H*hk⸮ r@D⸮6⸮P!H⸮⸮⸮H⸮⸮Kkį=⸮START esp8266_code.ino from Jan 3 2023
CC1101_SS_PIN in pin 15
CC1101_GDO0_PIN in pin 5
Test lecture VERSION du CC1101
Init CC1101 OK
Over and over and over a gain, i'm really sorry but i'm like 20 days onld in Arduino`
what is "onld"???
You just started with Arduino?
Is answering a simple "Yes" or "No" easy enough?
You just started in programming in general or do you know another programming language pretty good?
Is answering a simple "Yes" or "No" easy enough?
Do you understand what it means if I say
add serial debug-output to your code
Is answering a simple "Yes" or "No" easy enough?
1- what is "onld"??? = Old sorry i'm french elnglish is not my native langue.
2- You just started with Arduino?
Is answering a simple "Yes" or "No" easy enough? = Yes
3-You just started in programming in general or do you know another programming language pretty good?
Is answering a simple "Yes" or "No" easy enough? = No
4- Do you understand what it means if I say
add serial debug-output to your code
Is answering a simple "Yes" or "No" easy enough? = No
how about googling ESP8266 CC1101 ? = I already did that, i have the same code for a Arduino nano wich is working fine with the CC1101, but i want to make this work on esp8266 because i will be able to see the serial monitor data via wifi, on arduino nano i can not do that
Now this detail-information clears up a lot of wrong assumings that I made.
Due to the lack of more information my assuming was
you took this code from somewhere where it was already used with an ESP8266.
An Arduino Nano and an ESP8266 have very different microcontroller-internal hardware.
The code you posted in post # 1
is working on an arduino nano?
This code uses direct manipulating of SPI-IO-pins. This is very bad idea.
As the next step you should give an overview over your project.
transmitting data wirelessly is not a selfpurpose. What is the final purpose of transmitting the data wirelessly?
If you described this there is a good chance that a different but much better suited solution can be found.
Having almost no experience in programming and having no exprience in microcontroller-hardware makes it very likely that problems like this occur.
So please write a detailed description of
- what kind of data do you want to transmitt wirelessly
- for what purpose
- at what frequency (how often per second)
Hi simslim,
I repeat in my own words what I assume what you are saying.
This is a very important step to make sure to develop the correct functionality of the code.
You have a milking-machine that produces life-data. But the milking-machine is unable to store the data.
In one application you use a arduino-nano and a cc1101 for sending the data from the milking-machine over a distance of 10m to ??? what ???
milking-machine --->>---10m----->>>---receiver is what???
Then there is a second milking-machine which is 1000 meters away from your house
You want to send the data from the miliking-machine to your house by using a ESP8266
milking-machine--->>--ESP8266--------->>------1000 meters ------>>----------your house
I'm very unsure if this is a correct description. So you should read my description and write a corrected description in a new posting
best regards Stefan
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.