IC2 pic 18f452 program problems


Results 1 to 8 of 8

Threaded View

  1. #1
    MrSafe's Avatar
    MrSafe Guest

    Default IC2 pic 18f452 program problems

    Hi

    Hardware:

    Pic 18f452
    And I am trying to communicate and program a text to speed module.
    Heres the link to the module.

    http://www.picbasic.co.uk/forum/newt...=newthread&f=4

    The link to the tech sheet for the device:

    http://www.robot-electronics.co.uk/htm/Sp03doc.shtml

    I am using the pl1 pint section to program the unit:

    I use the SDA and SCL pins which connect to my pic.

    I am unsure how to program this unit I have tried with no success and with the unability to get any response for it. The unit has a default message which plays when you turn it on. Which is "thank you for purchasing the sp03".

    Heres my code that I am trying to use to talk with the unit:

    '************************************************* ***************
    '* Name : UNTITLED.BAS *
    '* Author : *
    '* Notice : Copyright (c) 2007 [select VIEW...EDITOR OPTIONS] *
    '* : All Rights Reserved *
    '* Date : 8/14/2007 *
    '* Version : 1.0 *
    '* Notes : *
    '* : *
    '************************************************* ***************
    '
    '---- Defining Modefier 4 serial in/out ----
    '
    include "modedefs.bas"
    '
    '---- Defining Oscillator ----
    '
    define OSC 4 ; Using 4MHz Oscillator
    '
    '---- Defineing Ports ----
    '
    TRISB = $00
    PORTB = $00
    TRISD = $00
    PORTB = $00
    '
    '---- Defining TX Variables ----
    '
    X var word
    Y var word
    '
    '---- Defining Variables ----
    '
    DEFINE I2C_HOLD 1
    define I2C_SLOW 1
    '
    '---- Starting Of Main Program ----
    '
    Main:
    pause 4000
    '
    Start:
    serout PORTD.0, T9600, [#80]
    pause 100
    '
    serout PORTD.0, T9600, [#00]
    pause 100
    '
    serout PORTD.0, T9600, [#04]
    pause 100
    '
    serout PORTD.0, T9600, [#02]
    pause 100
    '
    for x = 0 to 6 ; output the following
    lookup x, [$68,$65,$6C,$6C,$6F,$00],y
    serout PORTD.0, T9600, [y]
    pause 10
    next x
    '
    goto start
    '
    end

    I have also uploaded a copy of my code in a text file for anyone who needs to download it.
    All the fallowing code does is get the unit to say hello however I am unable to get it to say hello. I think first my programing code is wrong and two my hardware set up is wrong. Where do I connect the SDA pin to? and the SCL? do I simply connect the scl to a random pin on the pic? and the SDA to my data transmitting pin on the pic?
    Attached Files Attached Files

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. Replies: 288
    Last Post: - 25th August 2008, 16:53
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  4. Replies: 14
    Last Post: - 26th September 2007, 05:41
  5. Which pic has a big flash program memory?
    By amindzo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 1st November 2006, 19:35

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts