P-P-PIC up a TFT with chipKIT and DisplayCore

Did you know that chipKIT boards are probably the best choice for controlling a TFT screen?… Considerably better than most Arduino boards, that is for sure! I say that with confidence for three reasons:

  1. chipKIT boards typically have far more memory and computing power than many Arduino boards, and as a result, they are so much better at manipulating graphics and data for display.
  2. chipKIT boards can get the data out to the TFT screen so much faster though high-speed interfaces, so less time is spent redrawing things on the screen. You’ll find that images appear instantly, as opposed to being drawn out slowly.
  3. Finally my favourite reason: professional-grade library support. I say it’s my favourite because I designed and wrote the library myself, but I’ll tell you more about that journey later on.

First let me introduce you to a little friend of mine:

picadillo

This here is the Picadillo-35T developed by 4D Systems in Australia (also available from microchipDIRECT). The Picadillo is essentially a chipKIT MAX32 board with a nice, high-resolution TFT touch-screen strapped to the back. The meaty PIC32MX795F512L chip (also used on the MAX32) boasts plenty of RAM (128KB) and Flash (512KB) and all the other bells and whistles you have come to expect from chipKIT boards. The board also has the same connectors as the popular chipKIT Uno32, uC32, WF32 etc., so all your shields should just plug in and work. You also get sound thrown in to the mix with an on-board speaker, and of course you get an SD card slot–what self respecting board would be without one these days anyway?!

Ok, enough said about that. The main reason I write this post is to tell you of the most useful part of this Picadillo board: the TFT touch-screen. And let me tell you, it’s not just any TFT screen. It’s an above-average 3.5″, 320×480 resolution, crisp-image delivering screen. Not only that, but the way the TFT is wired to the PIC32 chip is also “above average.” The TFT connection boasts a 16-bit parallel interface, not the normal slow SPI interface that most cheap Arduino TFT screens give you–meaning that it takes one bus clock operation to output a pixel as opposed to 16 (a considerable speed increase!).

But that’s still not all! (I’m starting to sound like a TV salesman now. “Buy now and we’ll throw in this amazing clock radio and set of saucepans absolutely free!”). The TFT’s 16-bit interface has been directly connected to the “Parallel Master Port” (PMP) of the PIC32. The PMP is a bit like the old internal bus of early computers; you get an address bus, a data bus, and a bunch of control signals, meaning there’s no messy twiddling of GPIO pins with the likes of digitalWrite() (or even direct port manipulation using registers). Writing data to the screen takes just one instruction. That’s right – ONE instruction. And that means even greater speed. But wait, there’s more! (Here comes the gold-plated nose-hair trimmer…) It’s called DMA: Direct Memory Access. Guess what that can do! DMA can send data through PMP, and this essentially allows for direct communication with the TFT display, all without the MIPS CPU’s involvement! In effect, you can be outputting data to the screen whilst doing other things! All-in-all it’s really a thing of beauty… if you like that kind of thing, of course.

So what does all that mean to the layman? It means you have a well-designed, well-built bit of kit in a nice compact package with all the power you could ever want to make your perfect user interface. But isn’t programming user interfaces and drawing graphics on a TFT screen a hard job? Isn’t it fairly skilled and in-depth? Don’t you have to write reams and reams of code just to get it to print “Hello World”? Well, yes, you do. However I have already done all that for you. And that is where the journey to the core begins.

Continue reading P-P-PIC up a TFT with chipKIT and DisplayCore

VN:F [1.9.22_1171]
Rating: 9.7/10 (6 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

chipKIT WF32 Tutorials for Projects in LabVIEW LINX

Connect your LabVIEW™ projects to the real world! LINX from LabVIEW MakerHub is a free, open-source add-on for LabVIEW software. In this series of video tutorials, learn how to use LINX with the Digilent LabVIEW Physical Computing Kit in projects based on the chipKIT WF32™ board.

VN:F [1.9.22_1171]
Rating: 5.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)

chipKIT Pro and I/O Control

chipKIT Pro MX7 Development Board
chipKIT Pro MX7 Development Board

The Learn.Digilentinc site has some useful lessons, not only for beginners, but also for more advanced users of microcontrollers. For those of you who use chipKIT Pro products like chipKIT Pro MX7, Digilent put together the chipKIT Pro and I/O Control project to teach digital input and output using MPLAB X IDE and the MPLAB XC32++ Compiler. This project does require some basics skills/knowledge, like C or C++ programming, binary math and Boolean algebra, MPLAB X IDE basics, and a fundamental knowledge of electronics.

Happy Learning! 😀

VN:F [1.9.22_1171]
Rating: 7.3/10 (3 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

chipKIT IoT and Ubidots Cloud

chipKIT IoT and Ubidots Cloud
View your chipKIT variables via the Ubidots Cloud

The chipKIT embedded platform is a great starting point for developing Internet of Things applications. But how do you store and work with the data that your application collects? With the cloud-based Ubidots platform, you can collect and store your data as “dots.” Every time your device sends a value to their cloud, a “dot” is created. Ubidots offers a free “Maker Plan” which allows you to collect 30,000 “dots” per month.

To get you started, they have created some chipKIT-based application tutorials:

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Debouncing a Pushbutton

Overview:

A pushbutton is a Mechanical Switch. Switches play an important and extensive role in practically every computer, microprocessor and microcontroller application. Mechanical switches are inexpensive, simple and reliable. However, switches can be very noisy electrically. When a switch, such as a pushbutton is pressed, the connection actually makes and breaks several, perhaps even hundreds, of times before the final switch state settles. The problem is known as switch bounce.

The consequences of uncorrected switch bounce can range from being just annoying to catastrophic.

A software technique called “Debouncing” is one way to solve this problem. Here’s how it works:

Usually, the switch is connected to a pin on the Microcontroller so that it maintains either a HIGH or LOW condition when the switch is open (not pressed). If the switch closes (is pressed) then that condition will change. The Microcontroller detects that change. Instead of reacting right away, the Microcontroller will wait a period of time, say 5 mS, to give the switch a chance to stop bouncing and then checks that pin again. If the pin still reads that the switch is closed, then the Microcontroller will do something about it.

In this tutorial, a pushbutton press (BTN1) will trigger LD1 to light. Otherwise, LD1 will be OFF.

 

Reference:

This tutorial introduces the if/else statement. This type of statement gives your sketch the ability to make decisions based on conditions occurring outside of the Microcontroller or as a result of some sort of internal condition such as the result of some mathematical operation.

We recommend you read the following before proceeding:

 

Hardware Used:

The hardware used in this tutorial will be the chipKIT uC32 along with a chipKIT Basic I/O Shield both manufactured by Digilent Inc. The reference guide for each board, schematics and other resources are available on their individual homepages:

 

Procedure:

  1. Create a new sketch in MPIDE.
  2. Save the sketch with a meaningful name.
  3. Add the following code to your new sketch:
    int ledPin = 26;   // LED connected to digital pin 26
    int pbPin = 4;   //pushbutton BTN1 connected to digital pin 4
    int pbState = LOW; //this variable will hold the value or state of BTN1
                       // i.e. if not pressed, pbState = LOW, if pressed, pbState = HIGH
    
    void setup()
    {
      pinMode(ledPin, OUTPUT);   // sets the digital pin 26 as output
      pinMode(pbPin, INPUT); //sets digital pin 4 as input
      digitalWrite(ledPin, LOW); //make sure LD1 is OFF
    }
    
    void loop()
    {
    
      pbState = digitalRead(pbPin); //read the value, HIGH or LOW, on the pushbutton pin
    
      if (pbState == HIGH) //is pbState HIGH indicating BTN1 is pressed??
      //if yes, do the code inside the curly braces. This is the debounce section
      {
        delay(5); //wait 5 mS for any pushbutton bounce to disappear
        pbState = digitalRead(pbPin); //read the value on the pushbutton pin again
    
        if(pbState == HIGH) //is it still HIGH (pressed)
        {
          digitalWrite(ledPin, HIGH); //Light LD1>
        }
      }
    
      //otherwise
      else
      {
          digitalWrite(ledPin, LOW); //keep LD1 OFF
      }
    
    }
     
  4. In the MPIDE, verify that the chipKIT uC32 and the associated communication port are selected.
  5. Upload the code to the chipKIT Board.
   

Verifying Operation

After the sketch is sent to the chipKIT uC32 board’s Microcontroller, LED 1 (LD1) on the chipKIT Basic I/O Shield should light when pushbutton BTN1 is pressed.

   
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)