Would a pull-down resistor at each LED solve the problem?
Would a pull-down resistor at each LED solve the problem?
My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.
Not as dumb as yesterday, but stupider than tomorrow!
In fact the Pcb is done simply for the moment to get used to the MCP23017 that will serve me to something else after.
The PCB is composed of 8 LED simply placed on Port A and 8 LED placed on port B. The communication with the Pic I2C is done.
Pic also controls an LCD 2 * 16.
The test program is to enable a counter from 1 to 255 that will be displayed on the LCD (i = 1 until i = 255) and the 2 * 8LED (port A and port B).
At the first power, while port A is activated (LED lit) and port B is disabled (LED off). When the counter reaches + / - 130 (viewed from the LCD), Port A (which was fully activated) starts from the port B but it does not change state. And only when the counter recomm early as 2 port (A and B) fonctionnnent normally (they have at the same time as the LCD).
And it works very well.
The problem is powering up.
The problem must come from the Start Bit of the I2C.
I already tried some codes for the Start bit but I can not.
Aurra you an idea?
Again thank you for your reply
Claudy
Are you saying the MCP23017 is NOT used at the moment? Why issue an I2C command to something inactive? Do you have LEDs connected on the MCP23017?Originally Posted by CLAUDY
Originally Posted by CLAUDY
So you have 16 LEDs on ports A and B, but you also use Port A for I2C communication?Code:sda var porta.0 'sda est sur le porta.0 scl var porta.1 'scl est sur le porta.1
Why not use Port C.3 for SCL and Port C.4 for SDA (PIC 16F877 datasheet pinout p.3) to avoid interfering with your LEDs?
Plus ça change, plus c'est pareil...
KeyWord: Datasheet
Not ALL PORTA pins are true output... and on PORTB there's this PGM pin who could do nasty thingy if your CONFIG FUSES aren't set properly...
About them (Config fuses) Where are they?!?
Are we talking about a 877 or 877A ?
And finnally... you want to manually assign value to your PORT BEFORE doing anything else... say BEFORE the PAUSE 1000. Usually
PORTA=0
PORTB=0
...
TRISA=0
TRISB=0
....
Variable and all other code here.
Bonne chance
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Actually If I understand properly, it is worst than this. If the LED are connected to Ground on the I2C line, they Screw-up the line as they have to be Pulled-high (hi-z) but the LED LOAD it to gnd.So you have 16 LEDs on ports A and B, but you also use Port A for I2C communication?Code:sda var porta.0 'sda est sur le porta.0 scl var porta.1 'scl est sur le porta.1
Why not use Port C.3 for SCL and Port C.4 for SDA (PIC 16F877 datasheet pinout p.3) to avoid interfering with your LEDs?
Get rid of the LED on those I/O or, like BobyBert said, move the I2C line elsewhere (it doesn<t need to be on a specific SCL, SDA PIC line as you're using I2CREAD/I2CWRITE who's not using the built in SSP module). You want the I2C line on their own I/O.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hello,
Thank you for your answers.
When I speak of the port A and B have ports MCP23017 and not PIC.
The PIC used is a 877A.
The PIC controls only the LCD and I use the port A of the PIC to bond with the I2C MCP23017.
A big thank you for your help.
Soon
Claudy
Hi, Claudy
Following your adventures on many forums for a moment ... I still miss a small thing : YOUR USED SCHEME ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Hello Alain,
I still have not found the solution.
Here's a quick diagram as requested.Printing TEST MCP23017-sch.pdf
Thank you
Claudy
Bookmarks