chipKIT Pi 6502 Simulator

6502 Simulator
6502 Simulator

Want to slow down your chipKIT Pi just for fun? Simulate an 8-bit MPU with this “kewl” project that implements a 6502 instruction set simulator on a chipKIT Pi development board. The project was inspired by fond memories of the Commodore Plus/4 and C16 home computers (circa 1984). The simulation includes TEDMON (the machine code monitor) as well as the EhBASIC interpreter. Kudos to Darron M. Broad for creating this cool project!

Why not join in on the forum conversation while you’re at it?

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

Useful Resource for Programming chipKIT Pi

chipKIT Pi Development Board
chipKIT Pi Development Board

If you are an experienced Raspberry Pi® user, check out this resource page for the chipKIT Pi expansion board. It includes some useful pinout tables as well as instructions for programming the PIC32 MCU using native tools on the Raspberry Pi.

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

DC Motor Control using Raspberry Pi, chipKIT Pi and the Arduino Motor Control Shield

Overview

This post is intended to demonstrate compatibility of the chipKIT Pi with certain existing Arduino shields. In the second part of this post, we will also demonstrate how to communicate with the chipKIT Pi over a simple I/O line on the Raspberry Pi®, from a terminal window, to control the Arduino™ shield connected to the chipKIT Pi.

Hardware/Software Needed

Procedure

Let’s begin by simply controlling a common Arduino shield. NOTE: Always check the electrical characteristics of any shield that will be connected to the chipKIT Pi. As with the Raspberry Pi, this is a 3.3V system. Therefore, if a shield outputs voltages greater than 3.3V there is a possibility that you could damage the chipKIT Pi or the Raspberry Pi. Connect the Arduino Motor Control Shield as shown:
motor shield 1
  1. Start a new sketch in MPIDE
  2. We will be using Brian Schmalz’s SoftPWMServo library for this application. This is a very flexible library that will enable a PWM (square wave) output on any pin we like. This library comes already included as a core library with the MPIDE. Therefore, to use, simply add the header file to the library at the top of your sketch as follows:
      #include <SoftPWMServo.h>
  3. The remainder of the sketch follows set up as per the Arduino Motor Control Shield specifications. I’ve added comments to explain each line of code.
    //Include the SoftPWMServo Library
    #include<SoftPWMServo.h>
    void setup() {
      //set up channel B on the Arduino Motor Control Shield
      pinMode(13, OUTPUT); //Pin 13 controls direction
      pinMode(8, OUTPUT); //Pin 8 controls the brake
    }
    void loop() {
      //Turn the motor
      // First we disengage the brake for Channel B
      digitalWrite(8,LOW);
      //Depending on how your motor leads are connected to the Arduino
      //motor B header, the direction could be clockwise or counter clockwise
      //So let's just start by calling this direct 1 and drive pin 13 HIGH
      digitalWrite(13,HIGH);
      //We need to send a PWM to the Arduino MC shield to start the motor
      //turning. We also define a duty cycle that will set the motor speed.
      //The higher the duty cycle, the faster the motor will turn. Duty cycle
      //is set between 0 and 255.
      //So we send the PWM to pin 11 according to the Arduino MC specs at say
      // a duty cycle of 100
      SoftPWMServoPWMWrite(11, 100);
      //Let's run the motor for about 5 seconds
      delay(5000);
      //Now lets brake the motor
      digitalWrite(8,HIGH);
      //Give the motor a chance to settle
      delay(500);
      //change directions
      digitalWrite(13,LOW);
      //and run the motor for about 5seconds in the other direction
      delay(5000);
      //Again, we brake the motor
      digitalWrite(8,HIGH);
      //give the motor a chance to settle
      delay(500);
      //and repeat
    }
So, this is nothing really special and can be done on any chipKIT Board. However, we can make something pretty interesting by introducing some Python-based communication from the Raspberry Pi to the PIC32 MCU on the chipKIT Pi. Proceed to the next page to continue.
VN:F [1.9.22_1171]
Rating: 6.5/10 (11 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

See the New chipKIT Pi Board at Maker Faire New York

chipKIT Pi Banner

See the New chipKITTM Pi Board at Maker Faire

Come on out to the New York Maker Faire on September 21 and 22, 2013, at the New York Hall of Science. We’ll have demos of cool projects you can make at home, plus talk to chipKIT Embedded Platform and Arduino community experts. We’ll be selling chipKIT Uno 32 boards and the new chipKIT Pi boards  at special, faire-only discounts right at our booth. Project sheets will also be available or makers can download them later.
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)