LED dot matrix

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
teivel
Posts: 14
Joined: Thu Jun 26, 2014 4:02 am
Has thanked: 6 times
Contact:

LED dot matrix

Post by teivel »

Hi, I'm having trouble to active LED dot matrix connected to PIC16F88 using Flowcode v3. It is connected to port A and port B only with 16 pins.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: LED dot matrix

Post by Benj »

Hello,

You might need to post your program and a schematic of your circuit for us to be able to try and help you.

teivel
Posts: 14
Joined: Thu Jun 26, 2014 4:02 am
Has thanked: 6 times
Contact:

Re: LED dot matrix

Post by teivel »

I need help to display any character on the led dot marix
Last edited by teivel on Wed Jul 02, 2014 4:06 am, edited 1 time in total.

teivel
Posts: 14
Joined: Thu Jun 26, 2014 4:02 am
Has thanked: 6 times
Contact:

Re: LED dot matrix

Post by teivel »

I only know how to light up led from COL0-COL7 by giving output to portB which r , 254,253,251,247,239,207 and so on , but i have no idea what is the output to light up led at row0-7 and every single led pls help!!

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: LED dot matrix

Post by Benj »

Hello,

It's very hard to try and help without first seeing the schematic of the dot matrix (i.e. how it's wired up) and the Flowcode program your using at the moment.

teivel
Posts: 14
Joined: Thu Jun 26, 2014 4:02 am
Has thanked: 6 times
Contact:

Re: LED dot matrix

Post by teivel »

My bad , im using GOTT-8X8 DOT MATRIX 921-628 and im using flowcode V3 :|

teivel
Posts: 14
Joined: Thu Jun 26, 2014 4:02 am
Has thanked: 6 times
Contact:

Re: LED dot matrix

Post by teivel »

For each row and col of the GOTT-8X8 DOT MATRIX 921-628, all led will light up except the selected bit. For example , output of 1 is given in port B and 0 in port A. Thus the result will be all led light up except COL0. This is same to COL1 to COL7 and ROW0 to ROW7. To light up each COL, output of 254,253,251,237 bla bla need to be used. But this don't work on Row0 to 7. It's annoying me lol. Whn i give output of 254 to port A and 0 to port B , ROW0 will light up but also ROW5,6 and 7.


*( 0 must be inserted to output A so that all the led in ROW0 to ROW7 will light up, if there is no output for A, only row2 will not light up when there is output in port B, i has no idea why )

teivel
Posts: 14
Joined: Thu Jun 26, 2014 4:02 am
Has thanked: 6 times
Contact:

Re: LED dot matrix

Post by teivel »

This is how i display col0 to col5 1 by 1 , whn i use the same output on port A , the row5,6,7 lights up tgt ... pls help

#define MX_PIC

//Defines for microcontroller
#define P16F88
#define MX_EE
#define MX_EE_TYPE2
#define MX_EE_SIZE 256
#define MX_SPI
#define MX_SPI_B
#define MX_SPI_SDI 1
#define MX_SPI_SDO 2
#define MX_SPI_SCK 4
#define MX_UART
#define MX_UART_B
#define MX_UART_TX 5
#define MX_UART_RX 2
#define MX_I2C
#define MX_I2C_B
#define MX_I2C_SDA 1
#define MX_I2C_SCL 4
#define MX_PWM
#define MX_PWM_CNT 1
#define MX_PWM_TRIS1 trisb
#define MX_PWM_1 0
#define MX_PWM_TRIS1a trisb
#define MX_PWM_1a 3

//Functions
#include <system.h>
#pragma CLOCK_FREQ 19660800

//Configuration data

//Internal functions
#include "C:\Program Files\Matrix Multimedia\Flowcode V3\FCD\internals.h"

//Macro function declarations
void FCM_A();
void FCM_B();
void FCM_C();


//Variable declarations



//Supplementary defines


//Macro implementations

void FCM_A()
{

//Output
//Output: 0 -> PORT B
trisb = 0x00;
portb = 0;


//Output
//Output: 254 -> PORT A
trisa = 0x00;
porta = 254;


//Delay
//Delay: 50 ms
delay_ms(50);


//Output
//Output: 0 -> PORT A
trisa = 0x00;
porta = 0;


//Delay
//Delay: 50 ms
delay_ms(50);


}

void FCM_B()
{

//Output
//Output: 253 -> PORT A
trisa = 0x00;
porta = 253;


//Delay
//Delay: 50 ms
delay_ms(50);


//Output
//Output: 0 -> PORT A
trisa = 0x00;
porta = 0;


//Delay
//Delay: 50 ms
delay_ms(50);


}

void FCM_C()
{

//Output
//Output: 251 -> PORT A
trisa = 0x00;
porta = 251;


//Delay
//Delay: 50 ms
delay_ms(50);


//Output
//Output: 0 -> PORT A
trisa = 0x00;
porta = 0;


//Delay
//Delay: 50 ms
delay_ms(50);


}

//Supplementary implementations


void main()
{

//Initialisation
ansel = 0;
cmcon = 0x07;


//Interrupt initialisation code
option_reg = 0xC0;


//Loop
//Loop: While 1
while (1)
{
//Call Macro
//Call Macro: A
FCM_A();


//Call Macro
//Call Macro: B
FCM_B();


//Call Macro
//Call Macro: C
FCM_C();


//Output
//Output: 247 -> PORT A
trisa = 0x00;
porta = 247;


//Delay
//Delay: 50 ms
delay_ms(50);


//Output
//Output: 0 -> PORT A
trisa = 0x00;
porta = 0;


//Delay
//Delay: 50 ms
delay_ms(50);


//Output
//Output: 239 -> PORT A
trisa = 0x00;
porta = 239;


//Delay
//Delay: 50 ms
delay_ms(50);


//Output
//Output: 0 -> PORT A
trisa = 0x00;
porta = 0;


//Delay
//Delay: 50 ms
delay_ms(50);


//Output
//Output: 223 -> PORT A
trisa = 0x00;
porta = 223;


//Delay
//Delay: 50 ms
delay_ms(50);


//Output
//Output: 191 -> PORT A
trisa = 0x00;
porta = 191;


//Delay
//Delay: 50 ms
delay_ms(50);


}


mainendloop: goto mainendloop;
}

void interrupt(void)
{
}

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: LED dot matrix

Post by Benj »

Hello,

A 16F88 device has it's oscillator pins on A6 and A7 and also uses A5 as the reset pin. This could be why your not getting anything on these pins using PortA.

A6 and A7 can be configured as output pins if you set the configuration to use the internal oscillator, however even if you disable the external reset functionality the A5 pin can only ever be an input.

teivel
Posts: 14
Joined: Thu Jun 26, 2014 4:02 am
Has thanked: 6 times
Contact:

Re: LED dot matrix

Post by teivel »

Benj , how to set the configuration to use the internal oscillator?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: LED dot matrix

Post by Benj »

Hello,

You click chip -> configure and then set the OSC setting to INTRC I/O.

This sets the oscillator to the internal type. You then need to add the following code to the top of your program in a C icon to change the int osc frequency from 31.25KHz to 8MHz.

Code: Select all

osccon = osccon | 0x70;
Are you using E-blocks or your own circuit board? Current versions of the EB006 PIC multiprogrammer have a jumper to allow you to route the osc pins to the PORTA D-type socket when using the internal osc. Older boards do not have this option and the pins are hard wired to the external osc circuit.

teivel
Posts: 14
Joined: Thu Jun 26, 2014 4:02 am
Has thanked: 6 times
Contact:

Re: LED dot matrix

Post by teivel »

Hi, Benj
Im using eblock ( PIC16F88 )
trying now hehe

teivel
Posts: 14
Joined: Thu Jun 26, 2014 4:02 am
Has thanked: 6 times
Contact:

Re: LED dot matrix

Post by teivel »

Hi, Benj
I had follow ur instructions but it said "If your flowchart contains C code, please review this carefully"
Wonder if made mistake, here r the images for what i did what u ask Image
Image
Image
wonder if i do which part wrongly
Last edited by teivel on Thu Jul 03, 2014 4:11 am, edited 1 time in total.


teivel
Posts: 14
Joined: Thu Jun 26, 2014 4:02 am
Has thanked: 6 times
Contact:

Re: LED dot matrix

Post by teivel »

pls helpppppp

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: LED dot matrix

Post by medelec35 »

Hi teivel,
Try removing */ from your C code block
Although not causing any errors { } are not required.

What version of Flowcode 3 are using?


Also it is not recommended to use the basic configuration at all.
That was intended for older microcontrollers that had much less functions than modern day microcontrollers.
You can have the expert screen permanently enabled.
To do this:

On simple configuration screen
select options, then un-tick 'Use simple config screen'

When using Advance Config screen, just make sure watchdog Timer, low voltage programming and background debug & extended CPU are all off/disabled (only if you see that option as that only applies to some microcontrollers)

If your still having problems then you should just get a single LED to flash at the correct speed.
Take a look Here

If you need further help, you will need to upload your flowchart to this thread.

Matin
Martin

teivel
Posts: 14
Joined: Thu Jun 26, 2014 4:02 am
Has thanked: 6 times
Contact:

Re: LED dot matrix

Post by teivel »

hi matin, for your information im using flowcode version of 3, and the configuration is set as what u ask. The problem still exist, the row 0, 5, 6 & 7 light up together as i give output of the led of 254 at port A, in fact, tis output only light up col0 in port B, i have no idea how to light up only row0... tis is making me headache

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: LED dot matrix

Post by medelec35 »

teivel wrote:version of 3
There will be other numbers after the 3
For instance using Help, About Flowcode I can see I have got V3.6.11.53
There could be bugs if using a lower version.

Unless you can post your hex file and flowchart,
I'm sorry, I won't be able to help any further.

To post on these forums, when replying just select Upload attachment tab
Select Choose File, then browse to the file to be added.
Then select Add the file.
Repeat until all files are added.

Martin
Martin

teivel
Posts: 14
Joined: Thu Jun 26, 2014 4:02 am
Has thanked: 6 times
Contact:

Re: LED dot matrix

Post by teivel »

Hi, Matin. Below is the dot matrix I'm using
IMG_0884.jpg
(1.98 MiB) Downloaded 7156 times
. The version of flowcode is V3.6.11.53. My purpose is find out the output for every single LED. SO i try to light up each col and row first. This is the output i found for COL0-7
flowchart.jpg
flowchart.jpg (67.27 KiB) Viewed 25498 times
(due to using demo version of flowcode, the outputs can be used are limited ). Output for col6 and 7 are 191 and 127. When i try to light up row0 with the output of 254 at port A and 0 at port B, the led at row0 light up but also led at row5,6 & 7
flowchat row0.jpg
flowchat row0.jpg (6.32 KiB) Viewed 25498 times
. Please help TT

Post Reply