Hi,
Quick note to apologise for if I miss any information out from this initial post, if you ask for any more information i'll post it as soon as I can. I have hunted the forums on this and every other site to find a answer but to no avail.
Objective
Read PelcoP control command from a serial port and output the correct I2C control commands to the Titan Intelligent BLDC Motor along the SDA line asynchronously. This must be completed using Pic Basic Pro.
Progress
I started from the working C code that was given to me by the previous person assigned to the project. This C code works absolutely fine and reads the commands in and write the I2C commands out perfectly (although the code is badly written). The code can be seen here.
I slowly worked through using PicBasic with the PIC18F4550 to get it to flash the on-PCB led to test my programmer and code works correctly, which it does and then moved on to try to create a simple program that writes the I2C commands straight from code to the motor driver. This is where I got stuck and have remained stuck for a number of days. I need you help to get this program writing the commands to the motor dirver to get it to move.
Resources
Original C Code: Ccode.txt (Apologies about the write up, you will need to copy and paste it into a editor like notepad++ and set language to C)
Titan BLDC Motor I2C Protocol
PIC18F4550 Datasheet
The PicBasic code I am trying to get to work: blink.bas
Relevant InformationThanks for your help, replies e.t.c.
- The SDA line is connected to PORTB.0
- The SCL line is connected to PORTB.1
- The clock used is the 8MHz internal clock set by OSCCON = 110010
- I can see the output from the PIC trying to write to the camera but the camera remains stationary. It seems the output is working but the motor driver is not reading the data in.
- The SDA output from the C code and the PBP code seem to be the same.
- The SCL line on both programs remains high throughout the code process.
- The configuration bits set in the PBP file is there to make it match the C code config bits.
Bookmarks