Jump to content
43oh

Newbie - need help in choosing LaunchPad model


Recommended Posts

@@JohnDough - correct, no need for transistors or ULNs for OLED, just a few wires (or connections if you are making a PCB) - 4 for I2C, 6 for SPI. Some displays may have an additional pin for reset as well (as the Amazon version linket to has).

 

The driver code I posted earlier supports SSD1306 and SH1106 for I2C or SPI - SPI is fastest.

 

In OLED.h you will find two #defines related to this, remove the line #define SPIMODE for I2C and remove #define SSD1306 for SH1106.

 

I bought mine from eBay - documentation was not good so I spent some time to make them work, the I2C version had two addresses printed on the PCB and none were correct...

 

Please note that I cannot guarantee the code will work "out of the box" - but hopefully it will, be aware that I have only tested it with two different displays.

Link to post
Share on other sites
  • Replies 30
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

@@JohnDough --   The MSP430G launchpad kit includes a 32.768KHz crystal. It is not installed and you will need to solder it on place. I would not call it a beginner soldering job, but it isn't bad a

As an additional note, if you are willing to let the brightness be moderately low, you could get by without the uln2803, as each output will only  be driving a single led at a time, and use the npn tr

Well, here is the modified OLED driver code - it has a function for displaying a 3 1/2 digit numerical value (range is -1999 to 1999) utilizing the full width of the display. It supports both SPI and

Posted Images

Well, here is the modified OLED driver code - it has a function for displaying a 3 1/2 digit numerical value (range is -1999 to 1999) utilizing the full width of the display. It supports both SPI and I2C (set in OLED.h) - main.c contains a demo. It is for CCS - I am not using Energia.

 

Be aware that sometimes OLED displays can be a bit tricky to get working - there are subtle differences between the various versions available...

 

Hi Terjeio,

 

thank you very much for posting your code, I am trying to get it to work on a SSD1306, 128x64, SPI. It compiles and uploads to my M430G2553 flawlessly, but doesn't display anything.

I am now not entirely sure if the pins are defined the way they should be.

 

// OLED GPIO CONFIG
#define OLED_RES BIT1 // P2.1
#define OLED_DC BIT1 // P2.2
#define OLED_CS BIT0 // P2.0
#define OLED_SIMO BIT2 // P1.7
//#define OLED_SOMI BIT6 // P1.6; unused for OLED
#define OLED_SCLK BIT4 // P1.5
 
Being new to CCS, I can't entirely figure out which pins the signals should be on correctly. With the oscilloscope I see a square wave of 500 kHz on Port 1.4 which seems to correspond to "bit 4". But which of the two Bit1 should be on port 1?
 
Thank you very much for your help.
Link to post
Share on other sites

Oops - I had not corrected the comments earlier, the code is a mix from several sources. When I tried to run the code I could not get it to run again myself - I forgot I had another LaunchPad connected as a programmer for my Raspberry Pi power controller...

 

Try these defines, at least they are working for me - be aware that the display I have has no reset pin so I have not tested that:

#define OLED_RES BIT3	// P1.3
#define OLED_DC	BIT1	// P1.1
#define OLED_CS	BIT0	// P1.0
#define OLED_SIMO BIT2	// P1.2
//#define OLED_SOMI BIT6	// P1.6; unused for OLED
#define OLED_SCLK BIT4	// P1.4

post-45966-0-03638700-1442697022_thumb.jpg

 

 

Link to post
Share on other sites

Oops - I had not corrected the comments earlier, the code is a mix from several sources. When I tried to run the code I could not get it to run again myself - I forgot I had another LaunchPad connected as a programmer for my Raspberry Pi power controller...

 

Try these defines, at least they are working for me - be aware that the display I have has no reset pin so I have not tested that:

#define OLED_RES BIT3	// P1.3
#define OLED_DC	BIT1	// P1.1
#define OLED_CS	BIT0	// P1.0
#define OLED_SIMO BIT2	// P1.2
//#define OLED_SOMI BIT6	// P1.6; unused for OLED
#define OLED_SCLK BIT4	// P1.4

attachicon.gifIMG_7541.JPG

Hi Terjeio,

 

thank you very much for your help, this works now perfectly on my launchpad.

 

Pio

Link to post
Share on other sites

Hi, I was interested in trying to get it to run on my msp432 launchpad. If I make a new ccs-project with the 432 (and replace msp430.h with msp432.h , it gives me 26 compiler errors. I then looked in the porting guide ( ) which said tthat "The msp430dna.h helps translate several existing MSP430 intrinsics over to MSP432 equivalent." So I tried to include msp430dna.h, but apparently that file doesn't come standard with the CCS (6.1.1) installation. Does someone know where to download that file; google is not of any help, unfortunately. I'd be grateful for any help or hints.

Link to post
Share on other sites
  • 1 month later...

@@terjeio

 

Hi,

I've recieved the oled and tried to use it, but with no success.

The oled is I2C and comes with the follwing 5 wires:

RST,SDA,SCL,GND and 3.3V

 

This is what I did:

 

1) Connected wires (based on "When using I2C"  - http://energia.nu/pin-maps/guide_msp430g2launchpad/ )

  1. RST to RST (above P1.7)
  2. SDA to P1.7
  3. SCL to P1.6
  4. GND to GND  (near P2.3)
  5. 3.3V to VCC   (near P2.3)

2) removed jumper on P1.6

 

3) Commented in oled.h the line of #define SPIMODE 1

 

Still, nothing happens :(

 

Any idea what I'm doing wrong ?

 

The board itself should be fine, since I've checked the simple "blink" example,

using the internal led, and it works fine.

 

Thanks for your help,

Regards.

Link to post
Share on other sites

The I2C oled displays I used needed a GPIO for the reset line, so that you can trigger this pin during runtime. Try do remove the OLED reset line from the MSP430 reset line. Is it working? Otherwise take another pin and have a look if the library requires a GPIO to change the state of the OLED reset line.

Link to post
Share on other sites

It could be due to incorrect I2C address - the silkscreen on my display says it is 0x78 which is not correct, it is 0x3C - yours might be different.

Also, the initialisation sequence is not the same for SSD1306 and SH1106 driver chips. If you are not sure which to use try both by commenting out the #define SSD1306 statement in oled.h.

Link to post
Share on other sites

Good points @@terjeio ... The initialisation sequences even differ between different 1306-displays e.g.

. You have to read the data sheet carefully regarding the necessary steps ...

 

Regarding I2C address ... you could use the I2C address scanner code (and energia sketch) posted somewhere here in the forum to find the correct address if you are unsure.

Link to post
Share on other sites

@@terjeio, @@yosh

 

Thanks for your help.

 

The next 2 solved the problem:

1) Removed the RST oled line, from the MSP430

2) I changed from SSD1306 to SH1106 by commenting #define SSD1306 1

(Ive tried it before, but the RST oled line was still connected)

 

Now it looks like working fine,

Except that the RST oled line is not connected anywhere.

Do I need to connect it at all ?

 

Thanks again for your help !

Link to post
Share on other sites

@terjeio, @yosh

 

I manged to work with the oled with basic tests.

Just a reminder - I'm using an I2C oled screen.

 

Then I added Timer A interrupt, as explained here:

http://www.crash-bang.com/getting-started-msp430-timers-3/

 

From the timer interrupt, I manage to toggle the builtin led,

but when I try to write to oled (eg "Display7Seg"),

The program hangs in :

file:   oled.c

in function : OLED_SendCommand
line # 152
 
in the folliwng code:

while(I2CBCount)

I suspect the problem maybe with the RST line from screen,

which is not connected to board -

Any idea where to connect it ?

I didnt find in the code of oled.h/c anything that relates to it.

 

Also maybe the problem is that this oled code cannot be used from within interrupts ?

I saw that in the SPI code,

the functions are surrounded with __disable_interrupt and __enable_interrupt,

but this is not in I2C code -

Is it supposed to be like that and work ?

 

Thanks for any help.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...