![]() |
Forum Index : Microcontroller and PC projects : Temp LM335 voltage fluctuations
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Peter, To get the latest MMEdit, you need to update the MMEdit.TKN file in the program folder. There are a few fixes to the FIND dialog which will help when changing labels. This ZIP contains the TKN file. Extract it and replace the one in the program folder. MMEdit TKN file You might want to read this thread also. MMedit update discussion Jim VK7JH MMedit |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2442 |
hi peter, don't know if you are aware of it, but you can freely intermix blocks of code with and without line numbers. see the below example that has two blocks of 'historic' code embedded in a line-number-less container program. lines 10 to 60 are a classic speed test copied verbatim, while lines 110 to 160 are the same code with counters added. cheers, rob :-) Print "Sieve of Eratosthenes Speed Test" Start = Timer 10 W=500:Dim F(W):P=1:A=3 20 F(P)=A:P=P+1:If P>W Then GoTo DONE 30 A=A+2:X=1 40 S=A/F(X):If S=Int(S) Then 30 50 X=X+1:If X<P And F(X)*F(X)<=A Then 40 60 GoTo 20 DONE: Elapsed = (Timer-Start)/1000 Print Elapsed " seconds" I = 0 ' statement counter J = 0 ' line counter Erase F 110 I=I+4: J=J+1: W=500:Dim F(W):P=1:A=3 120 I=I+3: J=J+1: F(P)=A:P=P+1:If P>W Then GoTo FINI 130 I=I+2: J=J+1: A=A+2:X=1 Print ,P Chr$(13); 140 I=I+2: J=J+1: S=A/F(X):If S=Int(S) Then I=I+1: GoTo 130 150 I=I+2: J=J+1: X=X+1:If X<P And F(X)*F(X)<=A Then I=I+1: GoTo 140 160 I=I+1: J=J+1: GoTo 120 FINI: Print I " statements" Print J " lines" Print I / Elapsed " statements per second" Print J / Elapsed " lines per second" |
||||
pcaffalldavis![]() Senior Member ![]() Joined: 17/10/2011 Location: United StatesPosts: 187 |
Maybe I've been driving my car using old buggy whips and horse reins. Perhaps someone can educate this old horse and buggy guy. I strive to remain teachable. I've never connected a MAXIMITE to a windows computer using a USB cable. I do all my program development on a windows computer using notepad and line numbers. Then I save the text file as some filename.bas, manually load it on a SD chip, walk it over and insert the SD card in the MM and boot. After taking a look at Tassy Jim's MMEdit I see a Save & Run button. So I'm guessing there is some way to interface this MMEdit program with a MAXIMITE using a cable? Probably a USB cable? How is this done? That would be convenient. I saw in the CGMStick1 manual a reference to some MMIDE interface software, but I never had it. I never saw in their manual how to get it, find it, or run it. So all these years I've been driving my MM's using SD chips and a notepad text editor on a different not connected windows computer. So is there some way I can connect a windows computer directly o a Maximite and edit MMBasic programs, save them, and even run and test program revisions, all from an attached windows computer? That would be convenient! DO TELL We're all here 'cause we're not all there. |
||||
robert.rozee Guru ![]() Joined: 31/12/2012 Location: New ZealandPosts: 2442 |
i believe you can connect a maximite to any of the following: 1. a PS2 keyboard and VGA monitor, or, 2. a terminal via an RS-232 connection, or, 3. a PC via a USB cable and then run on the PC either a terminal emulator (such as Teraterm or GFXterm) or MMedit. i only use 28-pin micromites myself, which only support 2. and 3. the maximite has a built-in full screen editor, allowing editing of the basic program using the maximite itself. MMedit bypasses the onboard editor, carrying out the editing on your PC and then saving the program back to the maximite. to make a USB connection to the maximite you need to have installed the necessary USB-to-serial driver from here: http://geoffg.net/Downloads/Maximite/Silicon_Chip_USB_Serial_Port_Driver.zip personally, i'd suggest you start off with a terminal emulator before moving on to MMedit, but opinions may vary! cheers, rob :-) |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
You should be able to run your CGMMsticks powered from the USB. External power is OK too. Versions of Windows before 10 required a driver which you download from Geoff's website. Version 10 uses a builtin driver and the Maximite will appear as a "USB Serial Device" Windows Device Manager will tell you what port number has been assigned or most terminal programs allow you to search for active ports. In MMEdit, remember to select the Maximite V4.5 syntax file. There are a number of differences between the various devices and if you don't tell MMEdit what you have connected, things like "load and run" are likely to fail. There is an option in MMEdit to save the config in BAS file. That adds a few comment lines to the file recording the MMBasic version, device and COM port. Handy when you have multiple devices. With the Maximite, MMEdit transfers your file to TEMP.BAS and then loads/runs it. With later devices, MMEdit loads the program directly into memory. You might want to play with the "File Manager". You can transfer files to and from the Maximite without having to remove the memory card, something that is a bit fiddly on the CGMMstick. In most cases, anything that PRINTs to the screen, also goes out the USB port. The big exception is graphics. The Terminal emulator in MMEdit (Chat window) is not very good so if you are doing any extended monitoring, I would use TeraTerm or GFXterm. Jim VK7JH MMedit |
||||
pcaffalldavis![]() Senior Member ![]() Joined: 17/10/2011 Location: United StatesPosts: 187 |
Boy, that MM Edit is one powerful program. I'm getting the gist, and can do a few things besides see what a sloppy coder I've become; that variables and labels used report is humbling. Anywho, Couple questions if you folks don't mind. I see in MM Edit how files are loaded from the Windows computer, and I see how to connect to and start a chat with my Maximite 4.5. What I have not yet figured out how to do is after loading a program onto the MAXIMITE using or within a chat, how do I get that code over into the main MM Edit window. I suppose some folks prefer to keep their files on their window computer rather than on the MM, and that is fine, so do I. But when I want to work on the most recent version, I would like to load and use the version currently ON the Maximite. This is simply a safety procedure which in my mind helps avoid the possibility of overwriting the most recent archived version. I've gotten the habit of never starting programming work by using an opening a stored archived version of a program. I don't mean to be picky, I've just learned that with my forgetful mind it is better if I always start working from the most recent "active" version of a program rather than delve into the back-up archived versions which get added to and updated daily. That way I always have prior versions of every program for every day when programming changes are made. Hope that wasn't too confusing. So, how do I get the 'hottest' version of a program that resides on the Maximite, from the MM Edit Chat over into the MM Edit main window? Two other easy one's I'll bet. In the MM Edit Maximite version 4.5 chat what does the number field with arrows on each side do? It is located just to the left of the colour check box. And when a program is executing or running in a Chat screen to the right of the ten macro buttons there appears a box that changes colours from red to tan and maybe other colours. What do these colours signify? Thanks folks, this MM Edit is going to be great. So far I've only tried using it on a Win 10 computer 'cause folks said that might be a bit more automatic for a beginner. Later I'll try MM Edit on an old Win 7 tablet that can be dedicated to the computer bench. We just jumped to Daylight Saving Time this morning, so eastern Australia is only 18 hours ahead of me now instead of 19. I'm catching up. Ha! We're all here 'cause we're not all there. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
The number box is the delay between lines being sent to the maximite. If you don't have enough delay, the Maximite cannot keep up. IT is not as slaw at the MMEdit Chat terminal, but careful feeding is required. I run with 150mS and wouldn't go below that. The VT100 mode tries to emulate a VT100 terminal. It is VERY slow and suffers from buffer overflow unless you are a very slow typist. The coloured box to the right of the Macro buttons signifies an overflow condition. Orange appears regularly as is not a critical condition, just an indication that the program is busy processing. A red box indicates that an overflow is likely and data integrity is not guaranteed. If the red box appears too often, it it time to switch to Teraterm. To help the VT100 terminal cope, switch off colour mode both on the Terminal and on the device's editor. (Currently only the micromite plus and MMX have a colour syntax option in the editor) To get a file from the Maximite to the editor, use the File Manager. Select the file you want and either copy the file to your PC or by using the 'white arrow pointing to E' to copy direct into the editor, replacing anything that was there. If you edit the program on the Maximite, you will have to remember what you saved it as. Glad you're having fun. Jim VK7JH MMedit |
||||
pcaffalldavis![]() Senior Member ![]() Joined: 17/10/2011 Location: United StatesPosts: 187 |
I guess I need to get the nomenclature clear in my mind. MMEdit's main screen is called the Editor? The Chat to the Maximite/ Version 4.5 is called the Terminal Emulator? And in the Terminal Emulator there are several display/emulator types and options? And when I'm finished making changes in the Editor, and click on the SAVE/RUN button it saves the file as temp.bas, transfers that temp.bas file to and runs it on the Maximite in the Chat/Terminal Emulator mode? And then if I go back to the MMEdit Editor screen later and make further modifications I can click the SAVE/& RUN button again and it will make a new temp.bas, copy it to the Maximite, overwrite the earlier temp.bas version, and run the newer version in the Chat terminal mode? Very interesting. I never had so much functionality. So what do most folks do when they have a version they are satisfied with for the moment. Do they Copy and or Rename the latest temp.bas version so it won't get overwritten in the next editing/programing session? If so, do they rename it on the Maximite (which I'm not clear how to do through a Terminal Emulator) or do they usually do the renaming in the Editor and then use the MMEdit file manager to move it over onto the Maximite with its new (non temp.bas) name? I think I may be getting it. Boy, I see some suds funds heading south. Wahoo! Peter in Hyder We're all here 'cause we're not all there. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Yes, I do believe you have most of it covered. In the Chat window, I normally use the ASCII settings. You then have to type any commands into the input text box then send the full line to the Maximite. VT100 sends each character as its typed. HEX is handy for debugging. It is a very good idea to save different versions of your program as it progresses. Undo can only do so much. Have a look in Preferences. You can set a backup folder and time to do the automatic backups. I have mine set to backup every 30 minutes. I now have a folder with lots of old versions of my creations. Jim VK7JH MMedit |
||||
Azure![]() Guru ![]() Joined: 09/11/2017 Location: AustraliaPosts: 446 |
Hi, been offline for a few days and just read through the previous 6 pages posted. One thing that kept popping up in my mind was how your system was powered (from source to digital to analogue to device. there was mention of caps for smoothing out any spikes. You mentioned USB Plugpack as the power source but that was the only other mention I could find. As by now you would have learnt throughout the conversation the LM335 being an analogues output with resolution on the mV range is extremely suspectable in getting reliable and repeatable readings to any power issues. Do you have access to an oscilloscope to start probing the power-in, regulator output, Vcc and AVcc on the PIC chip and then also at the device? If we can asertain any noise, ripple, spikes (generated or induced) on the power lines we can then move on to determine what is causing these fluctuating readings (that should be very constant). A multimeter will not tell you (at the accurracy needed) if there is noise or spikes anywhere within the power circuitry. After that is sorted we can look at the problems of long leads on your sensors (fig8 or twisted pair) powering long runs where accurate voltage source and readings are needed. |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5091 |
pcaffalldavis, I am aware you did solve your problem with the CGMMSTICK by replacing it with a MAXIMITE. So this feedback may not be of interest anymore. But I keep wondering why the CGMMSTICK performs so much different (can't let go...). One difference I see between the 2 is the 3.3V regulator. The CGMMSTICK uses a very small MCP1700 regulator. Looking at the datasheet (it becomes technical). I read that you power the CGMMSTICK from USB (5V). - ThiThe MCP1700 has no heatsink, and is 336 degrees (C) per watt. - It regulates 5V USB down to 3.3V - The maximum operating temperature of the MCP1700 is +125C. - The "typical" temperature drift is 50ppm/ degree C Typically (even in a heated room in Alaska) it may be 20C. The power needed by the MX696 processor running MMBAsic is 150mA-160mA (Mono MM / Color MM). Thus 0.16 A Therefore the MCP1700 runs at 20C + (0.16 x (5V-3.3V) x 336) = 111 degrees C. That is pretty hot, and already close to its maximum. Every milliamp you draw extra from the 3.3V heats it up even more. The "typical" output voltage of the MCP1700 drifts (0.16 x (5V-3.3V) x 336) * 0.000050 = 15mV due to heating. Since there is no specification for maximum drift, this may very well be 40mV (the error you measure from the CGMMSTICK). Conclusion: A/ So the 1.8k resistors to the LM335's and potential relay drivers of LED's bring the MCP1700 over the edge of it's power limit. Potentially destabilizing the CGMMSTICK. B/ And the MCP1700 voltage drift due to high temperature may be related to the drift you experience. Good that you selected the MaxiMite to do the measurements. Regards, Volhout PicomiteVGA PETSCII ROBOTS |
||||
pcaffalldavis![]() Senior Member ![]() Joined: 17/10/2011 Location: United StatesPosts: 187 |
So much to ponder. I don't have an oscilloscope but now for the first time in my life I can see what I might finally use one for. My computer room is a steady 58-61 degrees F (15 C) so ambient heat is probably not contributing much to a MCP1700. I too wish it could be figured out, but I'm just in over my head on this one. BTW, the problem also happened when I powered a CGMMStick1 from a dedicated bench power supply and also when the MM was powered from a tablet computer USB power source. I've decided to put my energy for now into converting my program from line numbered code into unnumbered code while I wait for the one-wire DS18B20 temp sensors to arrive. I figure if you can't make something work with lots of time and effort sometimes it is just better to learn to adapt. At least I was able to put newer firmware on the CGMSticks so they will be able to utilize the one wire sensors. Cheerio! Thank you and Make a great day. Peter We're all here 'cause we're not all there. |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
Hi Peter, You mentioned your Bears, we have these, taken from our back patio. ![]() ![]() Paul. "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
pcaffalldavis![]() Senior Member ![]() Joined: 17/10/2011 Location: United StatesPosts: 187 |
My goodness Paul. They are huge, and look like they think they own the place. What do they eat? Hopefully not your garden. Peter We're all here 'cause we're not all there. |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
Peter I bet they think exact the same about us. ![]() ![]() causality ≠ correlation ≠ coincidence |
||||
palcal![]() Guru ![]() Joined: 12/10/2011 Location: AustraliaPosts: 1993 |
Luckily there are not many of them, just one mob of about 10-15. They graze on the grass but because it had not rained for a long time they came into the garden for something to eat. Because no one feeds them they are not used to humans so are still very timid. A week ago we got about 900mm. of rain (36 inches) so everything is green again. Paul. "It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all" |
||||
pcaffalldavis![]() Senior Member ![]() Joined: 17/10/2011 Location: United StatesPosts: 187 |
![]() This is more like what we get. Which explains why I'm usually with a side arm, even in my living room. (Only in seasons when bears are in town) I just finished cleaning up my program sans line numbers, and all the labels have now been customized. I runs great, amazingly, It is over 500 lines and I can't believe I didn't have a single typo customizing the labels. It shrank the file size from 26K down to 22K and now that the labels are so clearly defined I could probably take out even more of the comments. Tassy, you were right. I really did need to do this. And I must say MMEdit is pretty swell. Is there a way to sort or reorder the Program variables and Labels report? I'm still waiting for DS18B20's to arrive so I can get more precise temp measurements. Didn't someone say I'll need some 4.8K resistors? I better make sure I have those. Thanks folks. Make yourself a great day! Peter in Hyder Alaska We're all here 'cause we're not all there. |
||||
pcaffalldavis![]() Senior Member ![]() Joined: 17/10/2011 Location: United StatesPosts: 187 |
I don't have any 4.8K resistors. Can I use 5.1 K instead? We're all here 'cause we're not all there. |
||||
redrok![]() Senior Member ![]() Joined: 15/09/2014 Location: United StatesPosts: 209 |
Hi pcaffalldavis;That's the pullup resistor for the DS18B20's. The actual value is not particularly critical. The recommended value is 4.7K although I have tested them from 2.2K to 10K or so to 3.3V. BTW, there are a number of Temp and Humidity sensors for a few bucks that operate on the 1-Wire bus. redrok |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
yes, or just take a 4.7k resistor. ![]() Please download the manual for MMBasic 4.5 and the datasheet for the DS18B20. EDIT: redrok was faster! causality ≠ correlation ≠ coincidence |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |