![]() |
![]() |
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Technical Support
Join Date: Jan 1970
Location: Bath,UK
Posts: 4,351
|
That is correct behaviour. The A0 etc are for 'readadc' commands only and only use values 0-255.
For 10 bit values with readadc10 you must use the generic option instead, which can handle numbers bigger than 255 as required by readadc10.
__________________
PICAXE Technical Support |
|
|
|
|
|
#12 | |
|
New Member
Join Date: Sep 2008
Location: WI, USA
Posts: 28
|
Quote:
@ hippy: Considering the possibilities you mention (concerning the primary topic potential remedies), I'm thinking of two options at this point: Go back to PE 5.2.6, or upgrade to a 40X2. The 40X2 upgrade appears more practical to me, however, at a glance, I don't know how much work it will be to retrofit. I currently have the 40X1 mounted on an AXE022 board (see photo) and haven't looked/determined at this point if the pinout of the 40X2 is the same and/or what hardware modifications would be necessary to make the change. I also don't know at this point how much code modification would be required. I'm still pretty much a newbie at this, and time to work on the project further is somewhat limited. The program pretty much does what I want it to do right now with some minor exceptions. I don't believe that I can post it here efficiently due to its size (119K). There's anywhere between 1000 and 1500 lines of code and the Memory used is currently = 3901 bytes out of 4096. There are over 255 hi2cout... command lines alone, so it appears impractical to "comment out i2c related code". Perhaps I can e-mail it as an attachment to you directly for some basic format evaluation in the interest of modifying it to work with either of the 40Xn series as you suggest, or perhaps better still, evaluate for conversion for use with the 40X2 alone? I'm certainly not the most learned or efficient programmer of this sort and I'm sure that there are more efficient ways to achieve the same code objectives or improve upon it. I would be grateful for any help along these lines, within reason of course; perhaps only as far as to offer suggestions would be of value I'm sure. On a side note: I'm not sure at this point if the 40X2 provides any additional "fully functional" digital inputs (DI's) over the 40X1. I have utilized all such in this project including the portA pins as DI's, and as mentioned, portC (not fully functional, from the coding standpoint that is) is being used for i2c comms alone. I would like to gain at least an additional DI pin for the purpose of serin feedback control from the machine's uMP3 player; this alone may be justification enough for me to upgrade to the 40X2. Optionally, I haven't looked enough into utilizing/configuring one of the available I/O Expander (MCP23008) pins for this purpose, if indeed it is possible. All-in-all, I don't want to drift too far from the primary jist of this post and perhaps will address this matter in a separate, future main forum post if need be. Last edited by jsch2603 : 07-02-2010 at 20:45. |
|
|
|
|
|
|
#13 |
|
Technical Support
Join Date: Jan 1970
Location: UK
Posts: 13,555
|
I'm sure there's never been a separate 40X or 40X1 model as I'm sure we'd not take it out if it were there. I could be wrong.
To convert 40X1 code to 40X2 you can use the Programming Editor X2 Conversion Wizard. On the 40X1 all I/O pins ( except A.4 ) can be used as either input or output so that gives up to 39 inputs or 40 outputs. |
|
|
|
|
|
#14 |
|
Senior Member
Join Date: May 2008
Location: Merseyside, UK
Posts: 414
|
This is right for 40X2 but not 40X1...
__________________
Code:
symbol pinwherethealarmclockperhipheralontheothersideofthebedroomsendsanacknowledgementbackalongtheserialwireto = pin1
^
Error: Symbol too long - pinwherethealarmclockperhipheralontheothersideofthebedroomsendsanacknowledgementbackalongtheserialwireto
|
|
|
|
|
|
#15 | |
|
Senior Member
Join Date: Mar 2008
Location: Western Australia
Posts: 4,974
|
Quote:
Hope Rev Ed are listening/reading
__________________
: westaust55 Hey Hamlet, 2B OR NOT 2B = $FF |
|
|
|
|
|
|
#16 |
|
Member
Join Date: Jan 2008
Location: Perth, Australia
Posts: 83
|
I am sure there is a good reason, but why can't the AO etc buttons simply generate numbers up to 1023 instead of just up to 255?
__________________
GREENLEADER |
|
|
|
|
|
#17 |
|
Technical Support
Join Date: Jan 1970
Location: UK
Posts: 13,555
|
Don't forget that the educational sector is a target market for PICAXE and students often have very little programming or simulation experience. I suspect the rationale was that most people using simulation would be using READADC and only want and expect 0 to 255. Displaying 0 to 1023 and dividing by four or capping at 255 when READADC was used would create confusion for those people.
|
|
|
|
|
|
#18 |
|
Member
Join Date: Jan 2008
Location: Perth, Australia
Posts: 83
|
It hasn't really been a problem for me - I just use the generic input. Disadvantage is that all the ADC's read the same value.
Maybe another option is to put in a checkbox that allows you to choose between 8/10bit ADC's...
__________________
GREENLEADER |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|