Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 01:36 17 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Micromite V4.7 Beta 11

     Page 2 of 2    
Author Message
piclover
Senior Member

Joined: 14/06/2015
Location: France
Posts: 134
Posted: 12:04pm 14 Jun 2015
Copy link to clipboard 
Print this post

  robert.rozee said  i presume the reason for using the 3v3 (analog) supply as the reference was to allow the analog inputs to measure any voltage between ground and Vcc.[/quote]In fact, the PIC itself allows to select different reference sources: the AVdd (for measuring the position of a potentiometer, for example, or any of analog circuit which output swings from 0 to Vdd), from the internal reference (a cheap way to get a good, albeit not perfect, supply independent reference), or from an input pin configured as a reference voltage input (where you can hook a precision reference source, such as a LM336).
The problem with the Micromite (a problem which doesn't exist in the PICAXE), is that you can't configure the PIC from MMBASIC to use the internal reference or an input pin as a reference for ADC conversions...

[quote]if the internal reference were used directly for the A/D conversion then an extra external voltage divider would be required whenever an analog input was used.[/quote]You usually need an adjustable voltage divider anyway, when measuring absolute (i.e. not power-supply-relative) voltages, to make for the base/rated inaccuracy of the voltage reference and/or the tolerance of the components (especially resistors) of any analog circuit used to bring the voltage to measure into the voltage range suitable for the PIC.

[quote]it would have also been necessary to have a return value that indicated an over-range condition.[/quote]An ADC reading of 1023 (or Vref, after that reading is converted into a float by MMBASIC) is the sign you did hit the limit (and probably overshot the range.

[quote]the weakness with the pin(0) solution (apart from the resetting problems some folks have been seeing) is that it allows the programmer to read the reference just once at program startup, rather than requiring a reference read every time an analog input is performed. given that Vcc can drift as batteries run down, or temperature changes, reading the reference just the one time is not prudent.
I'm not at all "hooked" to the PIN(0) method and would definitely prefer to be able to select the reference I need (AVdd, or 1.2Vref, or an analog pin) instead...Edited by piclover 2015-06-15
 
srnet
Senior Member

Joined: 08/08/2014
Location: United Kingdom
Posts: 164
Posted: 12:32am 19 Jun 2015
Copy link to clipboard 
Print this post

Similar problem affecting COM2 port.

You can open COM2 and close it, but if you try to open it again (in the same program) you get;

[3] Open "COM2:9600" As #1
Error: Pin 30 is in use

$50SAT is Silent but probably still working.
For information on LoRa visit http://www.loratracker.uk/

 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 09:15pm 19 Jun 2015
Copy link to clipboard 
Print this post

  srnet said   Similar problem affecting COM2 port.

You can open COM2 and close it, but if you try to open it again (in the same program) you get;

[3] Open "COM2:9600" As #1
Error: Pin 30 is in use


COM1: is OK.
Trying to use "SETPIN x, OFF" also results in a Pin in use error.
If you try to PRINT to the port after closing you get an error so at least part of the CLOSE command is working...

open "com1:" as #2
print "COM1 opened"
close #2
print "COM1 closed"
open "com1:" as #2
print "COM1 opened"
close #2
print ""
open "com2:" as #2
print "COM2 opened"
close #2
print "COM2 closed"
open "com2:" as #2
print "COM2 opened"
close #2


results in:
RUN
COM1 opened
COM1 closed
COM1 opened

COM2 opened
COM2 closed
[17] Open "com2:" As #2
Error: Pin 9 is in use
>


JimEdited by TassyJim 2015-06-21
VK7JH
MMedit   MMBasic Help
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8603
Posted: 09:42pm 19 Jun 2015
Copy link to clipboard 
Print this post

Gents

You shouldn't be using b11 - there are other major problems which Geoff is aware of. Use b8 until Geoff has had a chance to issue a new beta
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024