another update for the updi programmer. get it from the SLA area. it fix a problem where the updi interface was not properly reset. this update performs very good at 1600000 baud.
there was no feedback about the 12 v pulse. but the mliab-snap will be supported in either 2086 or 2087. came a long way with this. notice that this snap programmer is great but requires r28 to be removed and it need a firmware update.
This may have been answered before, but I couldn't' find it in a search.
I guess I am looking for the best way to send and receive binary data over a software serial port.
I added a software UART to an ATMEGA2560 circuit on some unused pins using the OPEN COM...(#4) command. It works fine, and I can get my serial data in and out. However, the only BASCOM command to receive the input data from a software defined UART appears to be the WAITKEY command, and this will wait forever if there is no incoming serial data. I need to be able to exit the WAITKEY command if no data is received after I request it, after some timeout. Do any of the other serial commands like ISCHARWAITING work with the software UART?
I have done some testing, and it appears that if the software UART input is LOW, the WAITKEY will proceed, and return a value of $00, with or without the $TIMEOUT command. However, if the software UART input is HIGH, then the WAITKEY will hang forever. I have tried adding the $TIMEOUT = 1000000 command, but it does not seem to prevent this issue. Perhaps this is because of the Port Number I opened?
Using INKEY or GET instead of WAITKEY seems to give the same results. I cannot use INPUT, because the input is binary data, without CR or LF.
I looked at the newer SERIN and SEROUT commands, but they are only for Strings as well, and I'm not sure if they provide a timeout feature either. Also, the Baud rate calculation seems to be pretty far off, at least in version 184.108.40.206. Perhaps there is a way to use strings with binary data, but since $00 is in the data, I think that would terminate the string.
Any other ideas on how to accomplish this would be appreciated.
[b:94a00b176c][color=red:94a00b176c](BASCOM-AVR version : 220.127.116.11 , Latest : 18.104.22.168 )[/b:94a00b176c][/color:94a00b176c]
[quote:ecd6493445="njepsen"]but wrapped in an abrasive wrapper.[/quote:ecd6493445] As usual. Either stand it or ignore my message. [quote:ecd6493445]I DO understand how conditional compilation works, but had missed the point that[/quote:ecd6493445] I was rather stunned that you did not recognize the logical quandary that the compiler needs information at compile-time, which he only can get later at run-time.
[quote:ecd6493445]Why do i use constants and conditional compilation you ask?[/quote:ecd6493445] JP asked that and added the 'beginner'
Of course I asked myself too, but rather why your post did not first explain the exact purpose, instead of presenting an unusable solution. [quote:ecd6493445][code:1:ecd6493445]const has_pi = 1 const has_camera = 1 const has weather=0 const site_phone = "+64 1234567"[/code:1:ecd6493445][/quote:ecd6493445]This is well understood, but still does not explain your initial question, which was something about working with strings.
I will give some random hints: As [code:1:ecd6493445]const fred = "fre" + myvariable[/code:1:ecd6493445]does not work, it may be sufficient to put the variable's initialization into a constant first and then assign further. [code:1:ecd6493445]dim fStr As String * 30 const site_phone_cc = "+64" const site_phone_phn = "1234567" const site_phone = site_phone_cc + " " + site_phone_phn const fred = "fre" + site_phone_phn
fStr = const site_phone
#IF fred = "fre1234567" ' inlcude code #ENDIF[/code:1:ecd6493445] Also notice that the command VAREXIST() - despite its name - works also for constants, this allows for checking if a constant or variable was declared at all. [quote:ecd6493445]MWS you need to be careful that members are afraid to ask a question that you might consider a "beginners question" and get harpooned by your caustic response.[/quote:ecd6493445]I grew too old to care if my answer is seen as caustic or not.
Also I tend to serve as it comes in, means adapt my response on how good the question is done. For your case: you're in the forum since 15 years, not only you did ask a beginner's question, but you have asked beginner-like. Beginners often describe not what they exactly want, instead present an unsuitable solution, while the reader's first riddle to solve is: what does the TO want at all? Had you described in your top post exactly what you want, we'd be already further.
Also it seems you took offense from the description 'beginner', which - as well you acted alike - you are not. Your self esteem should be raised enough and you should be mentally sufficiently hardened to simply ignore that.
In contrary, what about if I would tell a beginner he asks beginner questions? Well, as this would be only obvious, would I do that? Likely no, as his level would show.
[quote:ecd6493445]and am not afraid to do so. [/quote:ecd6493445]Good, that's the proper attitude to withstand my answers [quote:ecd6493445]I do value your expertise.[/quote:ecd6493445]Thanks.
Hello MWS and thank you for your reply. As usual, your reply is very helpful and on the money, but wrapped in an abrasive wrapper. I DO understand how conditional compilation works, but had missed the point that [quote:1b0f969940] To resolve a constant, anything included into an equation needs to be a constant itself.[/quote:1b0f969940] and had overlooked the fact that a var in the equation is of course not evaluated until run time, not compile time.
Why do i use constants and conditional compilation you ask? I have 100 or so units in the field all of which use IDENTICAL code, but some do slightly different things and some for example have an on board raspberry Pi and others don't. Some units have cameras, some have different instrumentation so CC allows them to function as required, all with the same main code body, and a different setups in a list of const in the code header.
'main body #if has_pi = 1 ' do lots of things ' not compiling this code save me about 20% of code space, and makes a BIG difference to compile time #endif [/code:1:1b0f969940]
MWS you need to be careful that members are afraid to ask a question that you might consider a "beginners question" and get harpooned by your caustic response. I am not a beginner, but I am allowed to ask a beginners question from time to time, and am not afraid to do so. As a parting shot - I do value your expertise.
[quote:db3c8b0d25="Duval JP"]Njepsen is not a beginner,[/quote:db3c8b0d25]It is a beginner-like question. [quote:db3c8b0d25]if he pauses [i:db3c8b0d25](poses)[/i:db3c8b0d25] the question it is because he needs this feature.[/quote:db3c8b0d25]If he understands how conditional compilation works, then he can't want this feature, as it's an impossible one. [quote:db3c8b0d25]I assume because my variable can be changed after compilation[/quote:db3c8b0d25]He assumes right. It's an hen/egg problem. How would the compiler know whether to include code at compile-time, if the conditions for the inclusion are only set in later in run-time. Njepsen would do better to describe the problem, instead of an impossible solution.
[quote:0ad92032e1="njepsen"] [code:1:0ad92032e1] #if echo_site = tempstr 'do stuff #endif [/code:1:0ad92032e1][/quote:0ad92032e1] Maybe you ask yourself about the sense of conditional compilation and why you would use it in a place, where regular use of an IF/THEN command is due.