Sparkfun DosOnChip


Closed Thread
Results 1 to 8 of 8
  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

  7. #7
    Join Date
    Dec 2006
    Location
    Central Iowa
    Posts
    2


    Did you find this post helpful? Yes | No

    Default

    Tico,
    I have used those modules in a project last fall. Be prepared for some head scratching. These modules do have "potential" but the manual leaves a lot to be desired. I spent nearly a week of hair pulling and lots of web searching before I got the thing to work. My boss was quite pissed about that! I contacted Sparkfun, the original distributor, and the guy at DOSONCHIP and they were both quite aware of the inacuracies of the manual and even today their website claims to be updating it in January of 2007. Here it is April 2007. I talked to those folks in October and they seemed almost unconcerned that the device was a bitch to work with and the manual was confusing. And I've got over 25 years experience in electronics.
    I don't get it!
    I was stuck because I had already designed the PCB for 13 units and had all the other parts ready to go. I did figure it out and used it but it was a pain. They have one advantage over the competition and that is the small footprint.
    I don't have all my notes with me but here are some things from memory.
    The reset pin can't be left unconnected as mentioned in the manual. Also if memory serves, the CTS line active state is reversed.
    The command for writing is the most criptic thing I remember. When you send the command for write, you follow it with the number of bytes you intend to send. The module sends the quote character back to you and then you follow with the actual bytes. There is no way I could have deciphered that from the manual. I got that info from another "hair puller" on the internet.
    My advice to you is to hook the thing up on a breadboard and practice using it with Hyperterminal before you even think of using it with your microcontroller. I did that so I could actually see what the thing was doing.
    Good luck.

  8. #8
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Default

    Try the AlFAT chips
    I've worked with these guys before, and they have worked out all(most) of the bugs.
    www.ghielectronics.com/details.php?id=1
    Ron

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