7 segment displays

Status
Not open for further replies.
Here's https://ww1.microchip.com/downloads/en/devicedoc/spi.pdf a blurb on SPI. I2C and SPI are high speed serial interfaces. Chip I2C addresses are controlled by NXP. Chips are ASSIGNED addresses by NXP.

SPI is a lot like memory chips, where each device has a chip select.

Both interfaces can be "bit-banged", but usually they are implemented on the chip and the compiler may have calls for them.

I randomly picked the mbed platform to show some SPI routines. See https://developer.mbed.org/handbook/SPI
Mbed, is a totally web-based IDE for lots of architectures.
 
Thank you for your reply. The resource you put is also very helpful toi understand SPI.

In fact, ( I forgot to mention it) I ve already implemented SPI between a master and a slave. It still has some issues but it is transmitting. I used two different PIC models to implement this.
My question was , the MAX7219 ( or any other device that uses SPI communication) is obviously not a PIC, or a microchip chip, so do I have to program it? If so how??

( I have other question regarding the nature of SPI but I will ask them later in another thread)
 
No! The max72xx is a driver interface.... All you do is send the address of the digit 0~7 or a control command then the data to display or the control data.... Simple
 

Hello.
after a long time I notice your post again since I am not experimenting with mbed and one simple 7seg.
I wrote a simple program in mbed and it should work but for some reason PA2 and PA3 dont work. Can you help me?

I am using a STM32F091
and my program is
Code:
#include "mbed.h"

#define MASK (0xFF) // Pins 0,1,2,3,4,5,6,7
PortOut myIOs(PortA, MASK);
//PortOut my7Seg(PortA,MASK);

//values of the LEDs
int leds[10]={
     0b11000000,
     0b11111001,
     0b10100100,
     0b10110000,
     0b10011001,
     0b10010010,
     0b10000010,
     0b11011000,
     0b10000000,
     0b10010000
};

int main()
{
   while(1){
    for(int i=0;i<10;i++){
        // myIOs=leds[i];//0;
         //myIOs=0b01111111;
         myIOs=0b00000000;
       //my7seg=leds[i];
       //my7Seg
       wait(0.5); // 500 ms     
      }//for
    }//while
}

As you can see I turn on ALL the segments but for some reason the ones connected to PA2 and PA3 didnt light. Is there something special with these pins??

EDIT: I found out that PA2 and PA3 are disconnected by default! (something related to USART) and that if I want to connect them I have to solder and desolder some jumpers.

I wonder if there are other pins with this curios behavior???
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…