Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Uh huh.here is the pdf of the board
On a design note ... one should NEVER rely on fill to make the connection.
{
*****************************************************************************
* Name : UNTITLED.BAS *
* Author : [select VIEW...EDITOR OPTIONS] *
* Notice : Copyright (c) 2024 [select VIEW...EDITOR OPTIONS] *
* : All Rights Reserved *
* Date : 11/19/2024 *
* Version : 1.0 *
* Notes : *
* : *
*****************************************************************************
}
Device = 18F43k22 ' Tell the compiler what chip we are using
Clock = 8 ' Tell the compiler what we will be setting the clock to (Mhz)
//CONFIG MCLRE = OFF
'Config fOSC = INTIO67 ' Internal oscillator, IO on pins 6 and 7
#OPTION DIGITALLIO_INIT=TRUE
Include "SetDigitalIO.bas" // Include this file when we compile so that we can use keywords like 'setalldigital'
Include "utils.bas"
Include "convert.bas"
Include "intosc.bas"
Dim Row_1 As PORTA.0 //rows are the minute led anodes BLUE 3mm LEDS
Dim Row_2 As PORTA.1 //rows are the minute led anodes
Dim COLUM_1 As PORTB.2 //LEDS 60, 59. 7, 6, 5, 4, 3, 2, 1, 58
Dim COLUM_2 As PORTB.3 //DS 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
Dim COLUM_3 As PORTB.4 //LEDS 38, 39, 40, 41, 42, 43, 44, 45, 46, 47
Dim COLUM_4 As PORTB.5 //LEDS 27, 26, 25, 24, 23, 22, 21, 20, 19, 18
Dim COLUM_5 As PORTB.6 //LEDS 48, 49, 50, 51, 52, 53, 54, 55, 56, 57
Dim COLUM_6 As PORTB.7 //LEDS 28, 29, 30, 31, 32, 33, 34, 35, 36, 37
Dim LEFT_EYE As PORTC.5 // TO BLINK EVERY SECOND
Dim RIGHT_EYE As PORTC.6
//set all ports as outputs
TRISA = 0
TRISB = 0
TRISC = 0
TRISD = 0
TRISE = 0
PORTA = %00000000
PORTB = %00000000
PORTC = %00000000
PORTD = %00000000
PORTE = %000
Output(COLUM_1)
Output(COLUM_2)
Output(COLUM_3)
Output(COLUM_4)
Output(COLUM_5)
Output(COLUM_6)
COLUM_1 = 0
COLUM_2 = 0
COLUM_3 = 0
COLUM_4 = 0
COLUM_5 = 0
COLUM_6 = 0
While 1=1
//TURN ON ALL THE BLUE ANODE ROWS FOR TESTING
// colum_1 = 1 //mosfet
Toggle (LEFT_EYE) //portc.5
Toggle (RIGHT_EYE) //portc.6
DelayMS(500)
Toggle (LEFT_EYE)
Toggle (RIGHT_EYE)
DelayMS(1000)
Row_1 = 1
COLUM_1 = 1 //turn on mosfet
// DelayMS(1000)
COLUM_2 = 0 //turn on mosfet
colum_3 = 0
COLUM_4 = 0 //turn on mosfet
colum_5 = 0
COLUM_6 = 0 //turn on mosfet
Row_1 = 0
COLUM_1 = 1 //turn on mosfet
// DelayMS(1000)
COLUM_2 = 0 //turn on mosfet
colum_3 = 0
COLUM_4 = 0 //turn on mosfet
colum_5 = 0
COLUM_6 = 0 //turn on mosfet
DelayMS(1000)
wend
All of your mosfets are wired wrong. The body diode is always conducting even when the gate is low.Well, I finally got back to this project and ran into code or mosfet issues.
using this schematic and this code I get more than one LED on. Only one is supposed to be on. Curious, do mosfets tend to bleed when off? ONLY row_1 colum_1 should be on but several other LEDs are on some are dim.
Code:{ ***************************************************************************** * Name : UNTITLED.BAS * * Author : [select VIEW...EDITOR OPTIONS] * * Notice : Copyright (c) 2024 [select VIEW...EDITOR OPTIONS] * * : All Rights Reserved * * Date : 11/19/2024 * * Version : 1.0 * * Notes : * * : * ***************************************************************************** } Device = 18F43k22 ' Tell the compiler what chip we are using Clock = 8 ' Tell the compiler what we will be setting the clock to (Mhz) //CONFIG MCLRE = OFF 'Config fOSC = INTIO67 ' Internal oscillator, IO on pins 6 and 7 #OPTION DIGITALLIO_INIT=TRUE Include "SetDigitalIO.bas" // Include this file when we compile so that we can use keywords like 'setalldigital' Include "utils.bas" Include "convert.bas" Include "intosc.bas" Dim Row_1 As PORTA.0 //rows are the minute led anodes BLUE 3mm LEDS Dim Row_2 As PORTA.1 //rows are the minute led anodes Dim COLUM_1 As PORTB.2 //LEDS 60, 59. 7, 6, 5, 4, 3, 2, 1, 58 Dim COLUM_2 As PORTB.3 //DS 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 Dim COLUM_3 As PORTB.4 //LEDS 38, 39, 40, 41, 42, 43, 44, 45, 46, 47 Dim COLUM_4 As PORTB.5 //LEDS 27, 26, 25, 24, 23, 22, 21, 20, 19, 18 Dim COLUM_5 As PORTB.6 //LEDS 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 Dim COLUM_6 As PORTB.7 //LEDS 28, 29, 30, 31, 32, 33, 34, 35, 36, 37 Dim LEFT_EYE As PORTC.5 // TO BLINK EVERY SECOND Dim RIGHT_EYE As PORTC.6 //set all ports as outputs TRISA = 0 TRISB = 0 TRISC = 0 TRISD = 0 TRISE = 0 PORTA = %00000000 PORTB = %00000000 PORTC = %00000000 PORTD = %00000000 PORTE = %000 Output(COLUM_1) Output(COLUM_2) Output(COLUM_3) Output(COLUM_4) Output(COLUM_5) Output(COLUM_6) COLUM_1 = 0 COLUM_2 = 0 COLUM_3 = 0 COLUM_4 = 0 COLUM_5 = 0 COLUM_6 = 0 While 1=1 //TURN ON ALL THE BLUE ANODE ROWS FOR TESTING // colum_1 = 1 //mosfet Toggle (LEFT_EYE) //portc.5 Toggle (RIGHT_EYE) //portc.6 DelayMS(500) Toggle (LEFT_EYE) Toggle (RIGHT_EYE) DelayMS(1000) Row_1 = 1 COLUM_1 = 1 //turn on mosfet // DelayMS(1000) COLUM_2 = 0 //turn on mosfet colum_3 = 0 COLUM_4 = 0 //turn on mosfet colum_5 = 0 COLUM_6 = 0 //turn on mosfet Row_1 = 0 COLUM_1 = 1 //turn on mosfet // DelayMS(1000) COLUM_2 = 0 //turn on mosfet colum_3 = 0 COLUM_4 = 0 //turn on mosfet colum_5 = 0 COLUM_6 = 0 //turn on mosfet DelayMS(1000) wend
Curious, do mosfets tend to bleed when off?
I don’t know exactly what part you're using, but it looks like you have the fet connected wrong... the body diode is always going to conduct. Check the source and drain connections.
All of your mosfets are wired wrong. The body diode is always conducting even when the gate is low.
View attachment 147788