Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

Cow PI

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 6666
    replied
    You may be interested in this thread
    http://www.geotech1.com/forums/showt...ntrols-and-LCD

    Leave a comment:


  • Silver Dollar
    replied
    So our design is coming together. Here is a list of the pins we will use on the PIC 18F4550

    ' Use Port E0 - 2 for AD's
    ' Port D0 - 7 for TX, Damping, First, Second, Ground Balance and First2, Second2, Ground Balance2 Pulses
    ' Port A0 - 2 for First, Second, and Ground Balance Analog Inputs
    ' Port E0 - 2 for First2, Second2, and Ground Balance2 Analog Inputs


    ' SDI pins
    ' PORT A.3 = CS
    ' PORT A.4 = D/C
    ' PORT A.5 /SS - No SS on LCD?
    ' PORT B.0 = SDI
    ' PORT B.1 = SCK
    ' PORT C.7 = SDO - No Dout on LCD?


    ' Roto Switch Pins
    ' PORT B.2 = Roto Switch Can use Interupt to Signal Data Change
    ' PORT B.3 = Phase A
    ' PORT B.4 = Phase B

    We may have trouble with the timing when we try to digitize those analog channels but I have some 30F2020's that could be pressed into
    service as data gatherer's. The 18F4550 might end up as the user interface chip in the final design.

    The screen is basically 128x64 pixels 18 bits deep. There are no character functions and even no easy way to clear the screen!
    We'll have to create our own character set as well as a cursor function. The pixel data is 12, 16, or 18 bits. 16 might be easiest
    to implement as it's just 2 bytes, though the data is 5 - 6 - 5 (RGB).

    I think to start we'll use a fixed screen and just update the changing value;
    Click image for larger version

Name:	CowPIScreen.png
Views:	1
Size:	12.5 KB
ID:	338767

    The cursor will move between the various numbers and allow changing them. The rest of the screen will remain fixed. Later we can get more creative.

    Leave a comment:


  • Silver Dollar
    replied
    Well it seems the SPI lines are in a different place on the 44 pin chip so I drew up a new schematic with them correctly shown.
    There's a lot of pitfalls working with these chips. Even with Megs of documentation it's tricky to find all the info you need. The pins
    sometimes have 4 or 5 different functions and there is no clear cross reference on where each pin name is used. I think if you have
    been working with them from the start there is some historical knowledge that helps...
    Attached Files

    Leave a comment:


  • Silver Dollar
    replied
    I found a 1.8" color display for $5.19 shipped from Hong Kong!

    http://www.ebay.com/itm/141109430611...84.m1439.l2649

    You talk to it via SPI which is fairly simple to do in Basic. Here's the init code for Fast Master mode;

    'Set SPI pin directions
    dir PORTC.5 out
    dir PORTC.4 in
    dir PORTC.3 out


    'Set SPI Mode to master, with fast clock

    Set SSPCON1.SSPEN Off 'Turn off SPI (Prevents any weird glitches during setup)
    Set SSPSTAT.SMP Off 'Set clock pulse settings
    Set SSPSTAT.CKE Off 'Data write on rising (idle > active) clock (CPHA = 1)
    Set SSPCON1.CKP Off 'Clock idle low (CPOL = 0)
    Set SSPCON1.SSPM3 Off 'Select master mode and fast clock
    Set SSPCON1.SSPM2 Off
    Set SSPCON1.SSPM1 Off
    Set SSPCON1.SSPM0 Off
    Set SSPCON1.SSPEN On 'Enable SPI

    Then a simple subroutine will send a byte of data;
    ' SendToScreen (OutData, InData) Simultaneously send and receive a SPI byte


    Sub SendToScreen (In ScreenData, Out ScreenData)

    'Clear WCOL
    Set SSPCON1.WCOL Off

    'Put byte to send into buffer
    'Will start transfer
    SSPBUF = SPITxData

    'Read buffer
    'Same for master and slave
    Wait While SSPSTAT.BF = Off
    SPIRxData = SSPBUF
    Set SSPSTAT.BF Off

    End Sub

    We just have to figure out what to send! I imagine a graphical setup where
    you can adjust the pulse widths and spacing on the screen as line drawings...

    I'm trying to juggle the pins around and allow for the future to have 2 pairs of receiver pulses and 2 Ground Balance pulses
    as well as the analog inputs to possible sample the demodulated data.

    We need 5 pins for the initial pulses (TX, Damping, First, Second and Gnd Bal) and 3 more for future expansion (First2, Second2 and Gnd Bal2). So we'll use Port D for all 8 pulses.

    The SPI for the LCD needs most of Port C.

    We'll use A0 - 2 for Analog inputs for 3 channels and E0 - 3 for the other 3.
    A0 =First
    A1 = Second
    A2 = Gnd Bal
    E0 = First2
    E1 = Second2
    E2 = Gnd Bal2

    And we still have all of Port B for fun stuff like LED's and Rotary Encoders!
    Attached Files
    Last edited by Silver Dollar; 12-27-2013, 10:07 PM. Reason: Add Schematic

    Leave a comment:


  • Silver Dollar
    replied
    Well I got the MPLAB IDE simulator running and found my IF statements for reading the program select
    switches doesn't work. I also looked at the EEROM code and decided it is very slow so I will put the data
    in an array to speed things up a bit. The simulation I ran showed just 1us of overhead for the pulse timing.
    It will be easy to fudge in a -1us from each time period and we should be pretty accurate...

    Leave a comment:


  • Silver Dollar
    replied
    Well I got the comments in the ASM file to work and also discovered the PulseOut command.

    I'm looking for a simulator to check the code before I download it. The Microcode IDE has one but
    I'm not sure you can see a pin output in oscope format. I'd like to check the timing on the pulses.

    I need to add a programming port to the board I have and wire up a different regulator. I worked
    out all the wiring yesterday so need to fire the soldering iron up today. Though I just put a turkey
    in the oven so it might have to wait until Christmas is over...

    I found a cheap audio codec PCB ($20) ; http://www.mikroe.com/add-on-boards/...o-codec-proto/

    It might allow you to sample the input directly though this PIC might not have enough horsepower...

    Attached Files

    Leave a comment:


  • Silver Dollar
    replied
    I removed the calibration code for now. I think I figured out the OSC settings. You can use a 4 mhz oscillator
    and run the CPU and USB on 48 mhz through some magic in the chip!

    We now have 4 modes;

    1. Low Range - 50 us TX
    2. High Range - 150 us TX
    3. Minelab Mode - 250 us TX then 3 - 50 us TX and repeat
    4. Multi mode - Cycle through 3 ranges 250 us, 150 us, 50 us

    It compiles OK but not sure if it runs correctly. I included the ASM output.
    There is a way to get more info in the ASM output but I still have to figure that out.

    I can solder a board up today as the 4 mhz oscillator I got with it will work. It might be
    tricky to add the programming pins to it without a microscope but we'll give it a go...
    Attached Files

    Leave a comment:


  • Silver Dollar
    replied
    Here's an updated code file. Fixed some coding errors and added padding to make pulsetrains
    add up to some standard values. I'm not sure about leaving the calibration/delay reprogramming
    in the code. Without a display they might be like working in the dark.

    I'm having trouble finding an oscillator. It's a bit confusing on the PIC's on how to choose one.
    I'd like to run at 48 mhz for possible future mods but most 48 mhz moduals seem to be 3.3V.

    I found a 10 or 20 mhz oscillator in my junk pile (the label is missing) but I'm not sure how to
    set the config bits to get it to work...
    Attached Files

    Leave a comment:


  • Silver Dollar
    replied
    Here's the program a little more fleshed out. It allows for if the jumpers are set on the
    board you can reprogram the min delay for all 4 programs and also set TXWidth and the
    1stTo2nd delay for each one.
    Attached Files

    Leave a comment:


  • Silver Dollar
    replied
    Here's some initial code. It init's the ports and optionally writes 4 banks of prog data to EEROM.
    It continuously loops reading the 2 prog switches and loads program data for the equivalent bank.
    The wait x us command will wait for x microseconds so the program values are just the required
    microseconds. I need to solder the chip on my board in order to run this code and see how close
    we are on timing.

    We still need code to use the pots and do tuning and light the LED's but it's a start!
    Attached Files

    Leave a comment:


  • Silver Dollar
    replied
    The plan is to have a waterproof version with minimal controls and a full feature one with all the bells and whistles.
    I'll call them Mini Cow PI and Maxi Cow PI or Mini and Maxi for short.

    The difference would be some pots and switches. On the Mini these could be attached for programming and detached for use.
    On the Maxi these would be permanently attached.

    I thought of using 3 jumpers on the PIC 18F4550 board to control tuning.

    1. Coil Min Delay
    2. Tune
    3. Write to EEROM enable

    You would attach all jumpers to make changes.

    The front panel (or temp panel) would have Prog 1, Prog 2 switches TXWidth and 1st to 2nd Delay pots and a Write enable switch.
    (Hmm prog 1 = 2 switches would need to be permanent on mini).

    Leave a comment:


  • Silver Dollar
    replied
    Thanks for the info! I did my own investigations and came up with this;

    TC for different targets ---------Max response is TC x5 but we can use 1/2 that and we want 1TC between 1st and 2nd samples

    Nickel + Small gold 20 us -------------- x5 100 us --------------------------- 1/2 50 us --------------------------------20 us
    New Penny ---------35 us -------------- x5 175 us --------------------------- 1/2 86 us --------------------------------35 us
    Gold Ring -----------50 us -------------- x5 250 us --------------------------- 1/2 125 us -------------------------------50 us
    Dime -----------------55 us -------------- x5 275 us -------------------------- 1/2 137 us --------------------------------55 us
    Old Penny ----------70 us --------------- x5 350 us ---------------------------1/2 250 us -------------------------------70 us
    Silver Dollar -------200 us ------------- x5 1000 us -------------------------- 1/2 500 us ------------------------------200 us
    Silver Cob ---------500 us ------------- x5 2500 us -------------------------- 1/2 1250 us -----------------------------500 us

    To narrow down to 4 ranges we could use

    TXwidth - 1st to 2nd

    50 - 20
    150 - 60
    300 - 150
    600 - 225

    To play with the numbers a bit we could say 1st to 2nd = 1/2 TXwidth

    40 - 20
    80 - 40
    160 - 80
    320 - 160
    640 - 320

    Leave a comment:


  • 6666
    replied
    earings, bracelets, necklaces and rings would be nice.
    They would be nice
    I have some PI timings I think they are from Carl
    F=1Khz
    Tx pulse width 100us
    duty factor 10%
    1st delay 15us
    1st sample width 45us
    sample inter delay 200us
    2nd sample 45us
    8 or 10 inch coil

    Leave a comment:


  • Silver Dollar
    replied
    Well I find there is still some disagreement over whether varying the TX on time is useful or not.
    I am unsure whether to vary the TX pulse and snub the flyback or try for the highest voltage at
    flyback.

    Also the TX rep rate is a question as higher rates cancel noise better but slower rates illuminate
    targets better.

    Using the PIC processor will allow for experimenting and having a multitude of programs but I want to
    decide on the rest of the circuit and which possible inputs I need to reserve so I don't need to be
    rebuilding it over and over again.

    The goal is to work good on the beach and favor gold if possible. I don't need to find pinpoint size
    gold dust but earings, bracelets, necklaces and rings would be nice.

    People talk of the tau of different targets and TC but I haven't seen a list of different gold objects.
    Anybody have some numbers for these?

    Leave a comment:


  • Davor
    replied
    Look for autozero amplifiers and you'll get some ideas. Trouble with small signal in baseband is that it is prone to various offsets, including 1/f noise. Late sample provides the autozero function for just about any influence, be it earth field, op amp drift or 1/f noise.
    VLF could benefit from some chopper configuration as well, as the most of the chatters are in fact 1/f noise.

    Leave a comment:

Working...
X