Sparkfun DosOnChip


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Dec 2006
    Posts
    38

    Talking Sparkfun DosOnChip

    I am attempting to write some code to interface with one of there modules,
    Unfortunately I cant do any testing due to the fact they wont be in stock until May.

    If some of you use these please let me know if I am on the right track.

    @ DEVICE PIC16F877A,XT_OSC
    include "modedefs.bas"
    define CHAR_PACING 100
    define OSC 20
    DEFINE debug_mode 0 ' Debug sending True serial data
    DEFINE debug_reg portc ' Debug Port = PortC
    DEFINE debug_bit 6 ' Debug.bit = PortC.6
    DEFINE debug_baud 9600 ' Default baud rate = 9600
    DEFINE osc 20 ' We're using a 20 MHz oscillator
    DEFINE ADC_BITS 8 ' Set A/D for 8-bit operation
    DEFINE ADC_CLOCK 3 ' Set A/D clock r/c
    DEFINE ADC_SAMPLEUS 50 ' Set A/D sampling time @ 50 uS
    Define LCD_DREG PORTD ' Define LCD pins
    Define LCD_DBIT 4 'use upper 4 bits d4-d7
    Define LCD_RSREG PORTD
    Define LCD_RSBIT 2
    Define LCD_EREG PORTD
    Define LCD_EBIT 3
    DEFINE LCD_LINES 2
    Define LCD_COMMANDUS 2000 ' Command Delay (uS)
    Define LCD_DATAUS 50 ' Data Delay (uS)


    start:
    toggle portc.3
    serout portc.5,N9600,[13,13] 'send init autobaud string
    serout portc.5,N9600,["ow",13] 'open file for writing
    serout portc.5,N9600,["w","This is a test",13] 'write this is a test to sd
    serout portc.5,N9600,["q",13] 'close file
    pause 1000
    goto start

  2. #2
    Join Date
    Dec 2006
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    47 views and so one can even tell me if I am on the right track.

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Lightbulb Inquiring minds want to know . . .

    Hi Tico,
    I am a viewer, and I have never used the modules you suggested you are about to use. I do have a comment though, Why did you bother to setup for use of debug logic true, and then call serout N9600 which if memory serves is inverted?
    In fact why bother to setup debug at all as you have not used it in your code?
    And then there are defines for a parallel LCD. How many LCD units are you going to use?
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4
    Join Date
    Dec 2006
    Posts
    38


    Did you find this post helpful? Yes | No

    Wink for that inquiring mind.............

    The answer is simple I removed the code that was not relavant, The defines are for the final code. One port is being used as a debug port (portc.6) another port (portc.5) is being used to comm. with the DosOnChip module. I am not using a 232 driver just the resistor method that is why I stated N9600.
    The define for the LCD is what the final code will use, I wil only be using one LCD module.

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    You defined a 20 MHZ crystal, but set a XT osc... must be HS osc.

    Also make sure you disable the LVP mode as well.

    And the universal question.... why using SEROUT while this PIC have a built-in USART?

    O.K. you need an inverted mode....
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Dec 2006
    Posts
    38


    Did you find this post helpful? Yes | No

    Thumbs up

    Thanks for the advice mister_e.
    I am using the ezpic 4 dev board. I have quite a few more defines than needed for this example.
    So does this mean that I have written the commands to the DosOnChip module correctly? I have read the data sheet but not sure If i understood it corectly.
    I would like to start coding now since the modules will not be available for at least another month. They are claiming and arrival date of 2007-06-10, figures I found something else to tinker with and cant get one untill June.
    I am guessing that I need inverted mode to comm. with the module I figure two resistors are cheaper than a max233

Similar Threads

  1. Embedded MP3 player from Sparkfun
    By ScaleRobotics in forum General
    Replies: 3
    Last Post: - 10th March 2010, 04:41

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