• 0

How to check the OLED on uC 32 Basic I/O Shield...


Question

Hi,

I use uC 32 and Basic I/O shield in my microcontroller programming class.  I am using utility functions provided in class to display strings on the OLED, but it is not working.  I am not sure whether it is me that made mistake or the OLED is broken.  All other things (SW, BTN, ADC, and LED's) are working fine with the utility functions provided to control them.  I tried to get help from TA, but with remote class and all, it is rather difficult.  Can someone share a easy way to check if the OLED is functional?  I am using Pickit3 to program uC32.  Let me know if you need any more information.   

Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hi @tessue,

Are you working in MPLAB or the Arduino IDE? The Basic IO Shield Reference manual (link) has some material for the on-board OLED. Though looking at it, I'm not sure why they set the SPI2BRG value to 15 in the OledHostInit function since that does not set the SPI clock to 8 MHz as the comment indicates. It would instead set it to the SPI clock to 2.5 MHz which is almost 4 times slower. I would instead set the SPI2BRG to a value of 4 which would then set the SPI clock to 4 MHz like the MPIDE material (which will work with the Arduino IDE) does on the Basic IO Shield Resource Center (since I believe the Fpb clock is actually at 40 MHz rather than 80 MHz). There is some more details about this setting on page 29 of this document: http://ww1.microchip.com/downloads/en/devicedoc/61106g.pdf.

Let me know if you have any questions about this.

Thanks,
JColvin

Link to post
Share on other sites
  • 0

Thanks, JColvin.

Your answer is a bit over my head, but I will try my best to keep up with it.

Currently I am working with MPLAB with C (Pickit3 for programming) , and using some files the instructor provided to access many i/o devices on the basic i/o shield.  I attach them below in case you want to take a look.  

In the meantime, I just realize one thing.  All the class documents are based on Uno 32, and I am using uC 32.  Are they handle the OLED differently?  I had an error message when I program the board, and fixed it by choosing correct microprocessor when I set up the project.

I will read the documents you listed in your answer and get back to you to follow up.

Stay well... 

 

Ascii.c Ascii.h BOARD.c BOARD.h Leds.h Oled.c Oled.h OledDriver.c OledDriver.h

Link to post
Share on other sites
  • 0

Hi @tessue,

Material for the Uno32 and the uC32 should be the same as the board layout is the same; the uC32 just has some more internal memory.

One thought I that did have is what is jumper JP4 set to? I don't remember if it is by default set to RD4 or RG9, but you might try switching it to the other setting as the jumper only directs signals from one of the two ports to pin 10, which is what the OLED on the Basic IO Shield is using for the chip select pin as per it's schematic, https://reference.digilentinc.com/_media/reference/add-ons/basic-io-shield/basic-io_sch.pdf.

Thanks,
JColvin

Link to post
Share on other sites
  • 0

JColvin,

Yes, that's what thy said when I decided to buy my own uC32, instead of using their loaner Uno32.

I tried changing JP4 on and off, but no change.  BTW, the default setting was open (not connected).

I found the following though:

1. When I execute OledInit() from Oled.c and Oled.h, LD4 on the uC32 turns on.

2. When I execute OledDrawChar(), it returns 0.  I guess that means it failed to draw character.

Those function are found in 'Oled.h' and 'Oled.c'.

I am start thinking that my uC 32, not i/o shield, is broken.  Is there any diagnostics I can do to test it?

Link to post
Share on other sites
  • 0

Hi @tessue,

I apologize for the delay.

I'm not certain on the OledDrawChar function; it looks like in the Oled.c library the OledDrawChar function automatically returns false with no way for it to return true instead.

The way I would test the uC32 would be to test the individual pins with an external LED to see if setting the pin to a logic high and the cathode to a ground pin on the uC32 turns on the LED.

LD4 on the uC32 is connected to the serial clock on the default SPI "system" (SPI2 on the PIC32 processor), so I am not surprised that LED turns on as the serial clock would be running during those functions.

I looked further into the way that the library materials handle the OLED materials and see that you need jumper JP4 needs to be set to the RG9 side. I presume that JP5 and JP7 on the uC32 are set to the master position side?

Let me know if you have any questions about this.

Thanks,
JColvin

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now