Exact match. Not showing close matches.
PICList
Thread
'[SX] problems coding for MCP23016 expansion chip'
2007\10\19@180652
by
verobeln/a
|
|
Fellow SXers;
Some questions and code for you to look at...
I have been working on the SX/28 and some I2C chips. (So far: 24LC64 memory, DS1621 temp; and now MCP23016 expander) on the PDB board. Display is to a 2 Digit 7 segment LCD using RB and RC outputs. The display, temperature and memory have all been working and my latest addition is the expander chip. I now get compiler warnings & error
1) warning 37, pass 2: literal truncated to 8 bits
line MOV# __PARAM1,#wr23016 ;I2CSEND, wr23016
2) error 43, pass 2: address exceeds memory limit
.. I have tried commenting out portions of code..eg MEM_IN.. but still fall short
Is item 1 important?
Does item 2 mean my program is too big...and what to do about it?
How does the setup code and then EXP_IN, EXP_OUT code look for the MCP23016?
Thanks, John
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=225247
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)
2007\10\19@190230 by JonnyMacn/a
|
|
You have a LOT of SX/B I2C commands, and every one of them gets compiled in place and consumes flash. You can encapsulate these commands in subroutines/functions to get what you need without chewing up all of your flash. See my EEPROM example in this thread:
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=225247#m225255
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)
|
|
I assume this line:
DevType CON $0100 << 4 'Device type
Should be:
DevType CON %0100 << 4 'Device type
Note a "%" instead of a "$"
Even if you do fix this line, you are still out of code space. Use the techniques that Jon has suggested. Then you will have lots of code space left.
Bean.
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=225247#m225312
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)
2007\10\20@170631 by verobeln/a
|
|
*Thank you* gentlemen for your suggestions
I fixed the error above and stripped the program down to MCP23016 only code...
no more memory error. I will address Jon's suggestion to encapsulate code
in subroutines to avoid too much inline stuff.. later.
The lateset program is attached in file EXP1I2.SXB. It doesn't put anything
out on the display yet.. if I get a high on GP0.x it should work since doing
it manually with a wire..lights up a segment on the display.
I have some concern over the exterior capacitor 33 pf and resistor 3.9k.
The resistor is spot on but I'm uncertain of the capacitor value is is identified
with ( green 102M 1KV 250) .. I'm thinking it might be 250 pf. Meter says 2.1 nF..but
I'm not sure if it goes down that far. It may be another day or 2 before I can try
to get 33 pf at RadioShack. In the mean time do you think this one would work?
Any comments on latest source would also be appreciated..
EXP_OUT:
tmpB1 = __PARAM1 ' digit to display
I2CSTART SDA
I2CSEND SDA, Wr23016 ' send to who
'I2CSEND SDA, GP0 ' info for register .. would not compile, replace below
I2CSEND SDA, $00 ' info for register
I2CSEND SDA, tmpB1 ' the data to send
I2CSTOP SDA
PAUSE 100
RETURN
'I2CIN SDA, Rd23016, GP1, butCtrl
EXP_IN:
I2CSTART SDA
I2CSEND SDA, Wr23016 ' send to who
I2CSEND SDA, GP1 ' info for register
I2CSTART SDA
I2CSEND SDA, Rd23016 ' receive from who
I2CRECV SDA, tmpB2, Nak ' receive byte
I2CSTOP SDA
PAUSE 100
RETURN tmpB2
Thanks, John
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=225247#m225430
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)
|
|
102M
10 followed by two zeros, pF --> 1000 pF ("1nF")
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=225247#m225473
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)
2007\10\23@115338 by verobeln/a
|
|
I was able to get a 68pf capacitor. My nexxtech meter reads .07 nF .. I thinks its at its minimum measurement range.. I finally found the manual for it... need to press the 'REL' button before taking measurement this small..
Unfortunately, program still not working.
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=225247#m226048
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)
2007\10\23@131500 by verobeln/a
|
|
Hi all.. what a difference a couple days off makes... willing to recheck circuit and code.. find problem
Had wiring error mixup pin 19 vs 18... circuit now diplaying on 2 LED's, one direct from SX/28 the other thru MCP23016.
Currently have 1 question:
1) I currently have code to increment a counter: from 1 to 16 but it doesn't seem to work. What is wrong?
IF countB = 16 THEN
countB = 0
ELSE
countB = countB + 1
ENDIF
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=225247#m226070
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)
2007\10\23@132317 by JonnyMacn/a
|
|
Here's a slightly more elegant way to keep your value between 0 and 15:
INC countB
countB = countB & $0F
2007\10\23@141542 by verobeln/a
|
|
My code was ok.. I was just misInterpreting the result. I like your masking idea though.
One other question... is there some way to speed up the program download ..it currently takes me about 30 seconds.
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=225247#m226095
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)
2007\10\23@141955 by JonnyMacn/a
|
|
No, the download speed is what it is -- the only way to reduce the download time is to shrink the size of your program.
---------- End of Message ----------
You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=225247#m226096
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)
More... (looser matching)
- Last day of these posts
- In 2007
, 2008 only
- Today
- New search...