Searching \ for ' I need help' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/index.htm?key=need+help
Search entire site for: 'I need help'.

No exact or substring matches. trying for part
PICList Thread
'dual RS232, 40 kB ram, LCD display - I need help.'
1996\12\04@091449 by Ralf Sigmund

flavicon
face
Hello
I am about to start my first Pic Project. It is a small device that
should

 (1) accept digital data (numbers & strings) from a Measurement device
via RS 232 at  any time.

 (2A) store the Information in memory (approx. 20 Kilobytes of data)
 (2B) display the latest aquired data on a LCD display

 (3) send all data to a PC via a second RS 232

After reading some FAQs there remain still some questions:

What kind of Memory should I use (lithium battery backed up static ram,
EEPROM, Flash...)?
How do I wire the memory to a PIC? Any Circuits ?

How do I wire two RS 232 ports ( one with Hardware Handshake )? Do I need
a UART or is just a simple MAX 232 signal converter enough?
Where can I get Sourcecode for serial communications?

Should I try to program the PIC in assembler code or in a high level
language like C? My budget is very limited, as I am a student. I would
like to get a cheap development environment with lots of information on
using it, writing pic assembler code etc..

Does anyone know of information on similar project?

How can I get documentation on PICs from Germany. Do you know any
suppliers which ship to Europe, Germany?


Thank you for any hints.

Again thanks and Bye
  Ralf

1996\12\04@133022 by Brooke

flavicon
face
Ralf Sigmund wrote:
>
> Hello
> I am about to start my first Pic Project. It is a small device that
> should
>
>   (1) accept digital data (numbers & strings) from a Measurement device
> via RS 232 at  any time.
>
>   (2A) store the Information in memory (approx. 20 Kilobytes of data)
>   (2B) display the latest aquired data on a LCD display
>
>   (3) send all data to a PC via a second RS 232
.......
Ralf:

How about allowing the data to go directly to the PC.
Use a PIC to listen-in to the data and convert it to
ASCII and send to the LCD.  This can easily be done
using a 16F84.

Have Fun,
Brooke

1996\12\04@135058 by Shawn Ellis

flavicon
face
>How about allowing the data to go directly to the PC.
>Use a PIC to listen-in to the data and convert it to
>ASCII and send to the LCD.  This can easily be done
>using a 16F84.
>
>Have Fun,
>Brooke
>
Yeah, and the PC's rs232 buffer could be made to be quite large if you are
using something like Visual Basic in Windows 95...
Allowing you to record the data without the PC's attention...

1996\12\07@232030 by Alex I. Torres

flavicon
face
  Hi All PICers !

Wednesday December 04 1996 11:12,
spam_OUTRalf.SigmundTakeThisOuTspamSTUD.UNI-HANNOVER.DE wrote in PICLIST:

RS> I am about to start my first Pic Project. It is a small
RS> device that should
RS>
RS>   (1) accept digital data (numbers & strings) from a
RS> Measurement device via RS 232 at  any time.

You only receive data from this device ?  (1)

RS>   (2A) store the Information in memory (approx. 20 Kilobytes
RS> of data)

 It is the most problem. If you use 16C74 you can put one port as
DATA (8 bit), other ports as ADDRESS (15 bit for 32 kB)
and -CS,-WR,-OE (3 bit) : 8+15+3=26 bit. C74 have 33 bit I/O.
What about using 3x 6264 (8kx8 cmos static ram) or other with
more memory space (62256) ?  (I have many 6264 :-)
13 bit for address, and 3 bit for chip selection.

RS>   (2B) display the latest aquired data on a LCD display

If you want to built low-cost device try to use any 4-digit LCD
display with Microchip's AY-0438 controller. It require onle 3
wire (PIC's I/O) for communicate.

RS>   (3) send all data to a PC via a second RS 232

Only send ?  (2)

RS> After reading some FAQs there remain still some questions:
RS>
RS> What kind of Memory should I use (lithium battery backed up
RS> static ram, EEPROM, Flash...)? How do I wire the memory to a
RS> PIC? Any Circuits ?
RS>
RS> How do I wire two RS 232 ports ( one with Hardware Handshake
RS> )?

If (1) and (2) is true the best way is 16C74 that have serial port.

RS> Do I need a UART or is just a simple MAX 232 signal
RS> converter enough?

It's depend for the RS232 speed. If you not use high speed the
simplest (and low cost) solution is :
         +5v --------------| e
                   |      /
from PIC's TxD      R2   |/
   --->----- R1----|----|\  c
                        | \---------------------->---  RS232 RxD
                           |
                           |
                           R3         |\ |
                           |----------| /|-------<--- RS232  TxD
                          _|_         |/ |   |
                          ---+C1             |  R1,R2,R3 2-10 kOhm
                           |                 |  C1 5-100 uFx16-20v
                          _|_                |
to PIC's RxD                                  |
----------------<------------------------------

I dont remember, mayby PIC's signals must be inverted.

Resume:
using 16C74 with 3x 6264 and AY-0438 :
 8data+13address+3xCS+OE+WE+2xRS232+3xAY =31 bit.
You have 2 I/O free for handshake.
---------------------------------------------------------------------
  Best Wishes, Alex Torres.
  Kharkov, Ukraine, exUSSR.
  E-Mail To : .....altorKILLspamspam@spam@cook.kharkov.ua   via InterNet
              or 2:461/28             via FidoNet

--- GoldED 2.50.A0531+

1996\12\09@065353 by David Nicholls

flavicon
face
       Hi there,
               I'm interested in something similar ! I too am about to
start my first serious pic project and I intend to have serial i/o to pc,
16 digital inputs, 9 relay driver outputs an lcd display and up to 8k of
EEPROM (on serial i2c bus). I plan to use a pic16c74 with 9 outputs
dedicated to a uln2803 relay buffer. 8 pins multiplexed as one of 2 8bit
banks of digital inputs ( reading from an 8 bit tristate latch ) and also
drive 8 of the data lines on a hitachi lcd display. With the other 3
control lines provided by dedicated pins. A further 3 pins are allocated
to the multiplexing of the 3 devices ( A little overkill but not too
much) .
               Personally I have a preference to EEPROM on an I2C bus as
this only uses 2-3 wires and doesn't waste much board space or need
complex wiring.. As for the serial I/O. Well the 16c74 has its own serial
port but you may need a max232 to to convert its ttl outputs to the 12v
rs232 standard. However if these are you only needs then you may be more
inclinded towards using a pic16c84.. As this chip has an onboard eeprom 1k
for program storage. It is a much more project development friendly
device. If your program will fit in 1K and then data speeds are slow
enough to store in an EEPROM. ( serial rates probably would be ). Also
this chip is considerably cheaper than its larger counterpart. $12 as
opposed to $50 for the 16c74 EPROM ver. Irish Prices !) However if I
remember correctly the 16c84 may not have an inbuilt UART ( Only just
realised that ) so you may have to code this youself. (Tricky I recon)
Perhaps the 16c71 may be a happy compromise..
               Anyway as you probably realised I am  not the most
experienced in programing PICs but perhaps my suggestions may fuel
comments from other more experienced PICers. Anyway best of luck in your
endevours and let me know how you get on, as I will probably experience
similar problems.


                                       David Nicholls


On Fri, 6
Dec 1996, Alex I. Torres wrote:

{Quote hidden}


'PIC 16c84 4bit LCD interface - I need help'
1998\02\26@074242 by Ralf Sigmund
flavicon
face
After serveral trys to implement a 4 bit Interface to an HD44780 driven 2 x
16 LCD display I desperately seek some help.
I tried to use the code snippet Dave Duley posted some time ago.
Unfortunately it just did not work.
Perhaps I failed, because the source covered only the used functions and no
main program...
The Microchip AN 587 example code uses a 16c5x device.
As the only Pic Controller I have here is a 16c84 I ran into serious
problems
because i do not know all the registers and ports they use.
I am not sure in what order I should connect the RB lines to the Display and
if I should use rb0-rb3 or rb4-rb7 as data lines.
I tried Myke Predkos Thermo5 Basic Example which worked fine, but is an 8
bit interface without usage of the LCD R/W line.

Thanks for any help
Ralf

1998\02\26@084633 by Lauri Pirttiaho

flavicon
face
:After serveral trys to implement a 4 bit Interface to an HD44780 driven 2 x
:16 LCD display I desperately seek some help.
<etc...>

If you do not mind doing some actual coding yourself, the thing you
need is HD44780 manual. Now, fortunately, it is online. In

http://www.hea.com/hean2/lcdc/hd44780list.htm

at Hyundai pages you can find a rather complete manual for HD44780.
Notice the initilaization procedure, you need at the beginning.
You need that to set the 4-bit operating mode!

For 4-bit interface you need 7 lines: Enable, Register Select,
Red/Write and Data lines 4-7. Initiation of the 4-bit mode
is described in the "Initialization: By Instructions" link
and 8-bit data is written over the 4-bit interface with
most significant nibble first.

-- Lauri

---
<a href="http://www.ee.oulu.fi/~lapi/">For more info.</a>

1998\02\26@124602 by Steve Lawther

flavicon
face
    Ralf,
   
    see my test circuit and software for the 16C84 on
   
    http://ourworld.compuserve.com/homepages/steve_lawther/charlcd.htm
   
    This shows how to implement a 4 bit interface, and the test software
    gives you error codes, if it finds faults.
   
    Any problems, just shout.
   
               Steve Lawther
   


______________________________ Reply Separator _________________________________
Subject:      PIC 16c84 4bit LCD interface - I need help
Author:  MIME:EraseMEralf.sigmundspam_OUTspamTakeThisOuTSTUD.UNI-HANNOVER.DE at INTERNET-HUSKY
Date:    26/02/98 14:56


After serveral trys to implement a 4 bit Interface to an HD44780 driven 2 x
16 LCD display I desperately seek some help.
I tried to use the code snippet Dave Duley posted some time ago.
Unfortunately it just did not work.
Perhaps I failed, because the source covered only the used functions and no
main program...
The Microchip AN 587 example code uses a 16c5x device.
As the only Pic Controller I have here is a 16c84 I ran into serious
problems
because i do not know all the registers and ports they use.
I am not sure in what order I should connect the RB lines to the Display and
if I should use rb0-rb3 or rb4-rb7 as data lines.
I tried Myke Predkos Thermo5 Basic Example which worked fine, but is an 8
bit interface without usage of the LCD R/W line.
   
Thanks for any help
Ralf
   

1998\02\26@124607 by mike

flavicon
picon face
In message  <199802261345.PAA13729spamspam_OUTtk8.oulu.fi> @spam@PICLISTKILLspamspamMITVMA.MIT.EDU writes:
{Quote hidden}

Minor correction, I think you'll find the Read?write line is not
needed and should be tied low IF you don't want to read from the
display.

Regards,

Mike

1998\02\26@221805 by Adi

flavicon
face
Hi Ralf,

I am just beginning to tackle the same project, interfacing a PIC to
a HD44780 using the 4 bit interface. I am using a 74HC595 to free up
some I/O on the PIC. Anyways, you are supposed to use DB4 to DB7.
B.G. Micro sells some 2x20 LCD displays and their datasheet for the
display has some helpful info about the 4bit transfer. Their website
is http://www.bgmicro.com. I could also send the file if you like...

Regards,
Adi

{Quote hidden}

1998\02\27@003829 by Mark Lezama

flavicon
face
Ralf, if you want to used the HD44780 in a 4 bit interface:

1.- You have to used DB4-DB7 in the module it doesnt matter if you conect
rb0-rb3 or rb4-rb7 but you have to be wiser in what way you are sending the
information.

2.- When you circuit startup wait at least 15ms before send any inormation to
the HD44780.

3.- Put RS=0; R/W=0; dato=0011 (dato=DB7 DB6 DB5 DB4). dont check BF

4.-Wait at least 5ms.

5.- Put RS=0; R/W=0; dato=0011 (dato=DB7 DB6 DB5 DB4). dont check BF

6.- Wait at least 100uS.

7.- Put RS=0; R/W=0; dato=0011 (dato=DB7 DB6 DB5 DB4). dont check BF

8.- Put RS=0; R/W=0; dato=0010 (dato=DB7 DB6 DB5 DB4). this set 4 bit interface.
after this step you can check BF and have to send the commands for funtion sets,
etc.

Ralf Sigmund escribis:

{Quote hidden}

1998\02\27@015502 by Philippe

flavicon
face
At 13:29 26/02/98 +0100, you wrote:
>After serveral trys to implement a 4 bit Interface to an HD44780 driven 2 x
>16 LCD display I desperately seek some help.
>I tried to use the code snippet Dave Duley posted some time ago.
>Unfortunately it just did not work.
>Perhaps I failed, because the source covered only the used functions and no
>main program...

UMPS will help you to see why it does not work: it will simulate
the HC44780 LCD panel. Try it:

       http://www.sistudio.com/umps

Regards,
       Philippe.

 +--------------------------------------------------------+
 |  Virtual Micro Design                                  |
 |  Technopole Izarbel,                                   |
 |  64210 BIDART                                          |
 |  FRANCE                                                |
 |                                                        |
 |  Phone: +33 559.438.458   Fax: +33 559.438.401         |
 |                                                        |
 | E-Mail: TakeThisOuTp.techerEraseMEspamspam_OUTidls.izarbel.tm.fr                    |
 | URL:    http://www.sistudio.com/umps                   |
 +--------------------------------------------------------+







{Quote hidden}


'PIC 16c84 4bit LCD interface - I need help'
1998\03\03@202406 by Ron Kreymborg
flavicon
face
Ralf and Others

I started a project some time ago which included the requirement for a
2-line lcd display using a 4 line interface to a 16X84. Others on the
piclist helped me over a problem when I was setting the contrast
incorrectly (in fact not at all). The lcd module is now working well and
uses just 75 bytes (here a byte is 12 bits!).

For those who want to look at yet another lcd driver, it's on my web page
at http://www.shm.monash.edu.au/~r.kreymborg/pic/lcd.html and includes a test
program and all the necessary files in zip format to download.

Ron

On Thu, 26 Feb 1998, Ralf Sigmund wrote:

> After serveral trys to implement a 4 bit Interface to an HD44780 driven 2 x
> 16 LCD display I desperately seek some help.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ron Kreymborg                   Computer Systems Manager
Monash University               CRC for Southern Hemisphere Meteorology
Wellington Road
Clayton, VIC 3168               Phone     : 061-3-9905-9671
Australia                       Fax       : 061-3-9905-9689
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


'Incremental encoders, I need help please!!'
1999\04\13@172328 by Gavin Tennant
picon face
Hi,

Okay, I've tried searching through the archives but I just can't seem to
find the information I need! I know you guys are pretty brainy out there so
maybe you could help me?

I'm building what is known in my trade (sawmilling) as setworks.  This
basically measures the output from an optical rotary encoder counting the
pulses and measuring the distance travelled. The shaft of the encoder is
mounted onto a rack system with teeth. I've ripped out the old Klockner
Mueller system to build my own (it had lost the program and proved to
expensive to replace) but am having trouble getting pic (a 16C64A) chip to
count the pulses properly.

Right: Problem 1: The keypad to enter the sizes isn't being recognised
correctly! I based the program round one I found in the cookbook and
simulated it where it worked properly, just doesn't seem to work when
plugged in (the wiring is correct from the keypad to the chip, I've had that
checked) Any ideas??

Problem 2: Simple electrical fault here that I just can't fix.  The pic
drives a couple of relays to switch a 240V supply for the motors, this seems
to reset the whole system or mess the counting up, any electronics boffins
who can help with that one??

Problem 3: (I know, there's a lot of them!) The main problem is that it
doesn't count properly.  The encoder was built by a company who no longer
exist but I can get a replacement from a company called Ideacod. There
encoder which is the exact spec of my one is an incremaental PAO2 5 7 9 480
type encoder  Now, I can't really help with the numbers as I've gone and
lost the book with them in (I've phoned for a new one which I can supply to
anyone in the know!)  It's counting at 480 pulses per revolution, tooth
pitch of 8mm and 96mm per revolution of the encoder (or 0.2mm per pulse).
These pulses are basically being fed into the pic (after a bit of cleaning
up) to count and move the motors accordingly.  By the way, my idea is to
type the number in on the keypad and the whole shebang moves to that size.
The whole thing simulates correctly on mplab but doesn't work at all when
connected to the machine.

Can anyone help me out there please?? I've been at this off and on for over
a year now! If you want or need any more help with exact specs of this thing
or need to know anymore about what I've done then I'd be more than happy to
give you a copy of the source and/or circuit diagrams!

Again, I know this seems a lot but I'd be eternally gratefull to anyone who
can help!

Thanks and I'll be looking forward to hearing from you!!

Gavin Tennant

1999\04\14@005138 by Troy P.

picon face
{Quote hidden}


'[OT] RTX51 TINY users - I need Help!'
2000\05\11@103145 by Somasundaram Meiyappan
flavicon
picon face
Hi Piclisters,

Sorry this message is about a different micro altogether.

I am working on a project tht uses RTX51 TINY version. The program compiles
properly. But during execution, I am not able to execute any task other
than task0. I have included the program below. I use KEIL C51 Version5.2
and the RTX51 TNY files that come along with it.
I use the following lines to compile the code

C51 rtxchk.c51
BL51 rtxchk.obj RTX51TINY
OH51 rtxchk

Please let me know if I am missing anything.

Thanks and Regards,
Somasundaram Meiyappan.

////////////////////////////////////////
/* The Program File */

#include <rtx51tny.h>
#include <at89x51.h>

TASK0() _task_ 0
{
       P0 = 0xFF;
       P1 = 0xFF;
       P2 = 0xFF;
       P3 = 0xFF;

       os_create_task(1);
       os_create_task(2);

       os_send_signal(1);
       os_send_signal(2);

       while(1)
       {
               P1 = 0x01;
       }
}

TASK1() _task_ 1
{
       os_wait1(K_SIG);
       while(1)
       {
               P2 = 0x01;
       }
}

TASK2() _task_ 2
{
       os_wait1(K_SIG);
       while(1)
       {
               P3 = 0x01;
       }
}


'[PICLIST] I need help'
2001\04\18@125321 by Martin Velez
flavicon
face
Hello everybody, i'm a new begginer in the pic´s world but  i don´t have
information to learn about it, somebody could tell me where found this
information or send it by email, thanks.

an apologize for my english

regards.
--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\04\18@130107 by Martin Velez

flavicon
face
Hello everybody, i'm a new begginer in the pic´s world but  i don´t have
information to learn about it, somebody could tell me where found this
information or send it by email, thanks.

an apologize for my english

regards.

Martin Velez
--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\04\18@130525 by David VanHorn

flavicon
face
At 10:46 AM 4/18/01 -0600, Martin Velez wrote:
>Hello everybody, i'm a new begginer in the pic´s world but  i don´t have
>information to learn about it, somebody could tell me where found this
>information or send it by email, thanks.

http://www.microchip.com is the fount of all knowlege :)

--
Dave's Engineering Page: http://www.dvanhorn.org
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\04\19@005247 by BENEDICIC SAMO

flavicon
face
I found this tutorial very helpful.

http://pc-tek.hypermart.net/pic.html

Regards, Samo

-----Original Message-----
From: pic microcontroller discussion list [PICLISTEraseMEspam.....MITVMA.MIT.EDU]On
Behalf Of Martin Velez
Sent: Wednesday, April 18, 2001 6:46 PM
To: EraseMEPICLISTspamMITVMA.MIT.EDU
Subject: I need help


Hello everybody, i'm a new begginer in the pic´s world but  i don´t have
information to learn about it, somebody could tell me where found this
information or send it by email, thanks.

an apologize for my english

regards.

Martin Velez
--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\04\19@012058 by Tony Nixon

flavicon
picon face
> Hello everybody, i'm a new begginer in the pic´s world but  i don´t have
> information to learn about it, somebody could tell me where found this
> information or send it by email, thanks.
>
> an apologize for my english
>
> regards.
>
> Martin Velez

Maybe try...

http://www.bubblesoftonline.com/projects.zip

-- Best regards

Tony

mICros
http://www.bubblesoftonline.com
RemoveMEsalesEraseMEspamEraseMEpicnpoke.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.



'[PIC]: My Servo code that i need help on plz?'
2002\01\04@021229 by Prince Anamalech
picon face

Here is my servo code?

i am not sure how good it all is ? as i am new to mplab and assembly language!

but i think i may have gone wrong with the servo updates somewhere? ??? :)

each servo is on porta.0 and port a.1 of my 16f84? but i have only written some code for one servo? how do i implement two and get the code to work for me? eg. backwards,forwards?

Below is the code!

Thankyou all in advance

anamalech

;"SmartBot Servo Test Program - Written By Anamalech"
INCLUDE "P16F84.INC"

BSF     STATUS,RP0         ;Set register bank 1
        CLRF    TRISA     ;Set All PORTA Pins to outputs

Counter         EQU     0Ch             ;Servo delay counter register
Position        EQU     0Dh             ;Servo Position register

#DEFINE  Servo1  PORTA,0  ;Defines Servo (A.0) I/O Pin on PIC16F84


Servo           MOVLW   0               ;Load Counter with # of cycles for
                MOVWF   Counter         ;1 ms Servo Delay
                BSF     Servo1          ;Activate the Servo output
                CALL    Delay           ;Wait for 1ms to pass
                MOVF    90,0            ;Load W with servo posi tion
                                        ;00 & FF=extremes, 128=centre
                MOVWF   Counter         ;and store in Counter for next delay
                CALL    Delay           ;Keep servo active for position delay
                GOTO Servo 

Delay           ;Servo time delay
                NOP                     ;Pad the loop with one cycle
                DECFSZ  Counter         ;Counter=Counter-1
                GOTO    Delay           ;If Counter is not 0, repeat
                RETURN                  ;If 0, return

END

       

 

 




 

 
Web: www.anamalech.multiservers.com
 
Email: anamalech@hotmail.com


Send and receive Hotmail on your mobile device: Click Here
-- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.

2002\01\04@040525 by ards, Justin P

flavicon
face
I will have a go ...

I am guessing from all I have read on the list that servo's are Pulse Width
Modulated.

You initially set the counter to zero, then turn portA.0 on.  The delay is
called and decs counter by 1 so result is 255.  So it continues to count
down to 0 and that's when it will return. (This may or may not be 1ms)

On returning you set the counter to 90 and call the delay.  (This delay
being 90/256  of the first delay) but the code does NOT turn off PortA.0
i.e. BCF Servo1 after the first Delay Call.  I think this is the problem for
Servo1.

To control Servo2 you will need to define as you have for Servo1 and then
add the instructions BSF Servo2 and BCF Servo2 in the right places.

To control them independently, well that's a little more involved.  You
could use inputs that when active you change the values that you put into
counter for the delays.  i.e. increment or decrement counter values as
required.

I hope this helps, I am reasonably new to this myself so I may be leading
you astray.

Justin

{Original Message removed}

2002\01\04@115242 by Steve Faulkner

flavicon
face
Source code for controlling multiple servos with the 16f84 is available on
http://www.piclist.com

----- Original Message -----
From: "Richards, Justin P" <RemoveMEJustin.Richardsspam_OUTspamKILLspamTEAM.TELSTRA.COM>
To: <RemoveMEPICLISTTakeThisOuTspamspamMITVMA.MIT.EDU>
Sent: Thursday, January 03, 2002 11:45 PM
Subject: Re: [PIC]: My Servo code that i need help on plz?


> I will have a go ...
>
> I am guessing from all I have read on the list that servo's are Pulse
Width
> Modulated.
>
> You initially set the counter to zero, then turn portA.0 on.  The delay is
> called and decs counter by 1 so result is 255.  So it continues to count
> down to 0 and that's when it will return. (This may or may not be 1ms)
>
> On returning you set the counter to 90 and call the delay.  (This delay
> being 90/256  of the first delay) but the code does NOT turn off PortA.0
> i.e. BCF Servo1 after the first Delay Call.  I think this is the problem
for
{Quote hidden}

> {Original Message removed}

2002\01\05@042818 by Alexandre Domingos F. Souza

flavicon
face
>Source code for controlling multiple servos with the 16f84 is available on
>http://www.piclist.com

       Sure, but where is the FUN?

       I want to roll my own ;o)


---8<---Corte aqui---8<----

Alexandre Souza
EraseMEtaitospamspamspamBeGoneterra.com.br
http://planeta.terra.com.br/lazer/pinball/

---8<---Corte aqui---8<----

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body



'[PICLIST] I need help with programming!'
2002\02\22@114414 by geci
flavicon
face
Hi guys!.

I really need someone who has a real knowledge about in some of these fields
applied to PIC micros: fuzzy logic,neural netowrking and genetic
algorithms.In case of you have one of these knowledge please contact to me.

Thanks a lot and forgive my impatient.


Gabriel

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics



'[PIC] I need help with my I2C code.'
2019\10\19@175304 by James Burkart
flavicon
face
part 1 1067 bytes content-type:text/plain; charset="utf-8" (decoded base64)

I wrote up a bit-bang I2C routine to communicate with a couple devices, an
SSD1306 OLED and an MCP23018 port extender. I'm using a PIC18F27K40.

I've got the sending data part just fine, but I can't figure out the
receiving part, including reading acknowledge bits. I, in large, copied the
code example from a blog post by Calvin Cherry (
calcium3000.wordpress.com/2016/08/19/i2c-bit-banging-tutorial-part-i/
).
To be honest, the way he was switching SDA between an input and output was
confusing to me and so I just enabled open drain on the port pins in
question. And that's why I can write to the I2C bus just fine, but reading
from it I am stumbling. For my bit read function I change the port pin used
for SDA to an input and read its value through PORTCbits.RC7 but it's
always reading 0.

I'd like to use the hardware I2C but I can't get the MCC code to work,
either the Foundation Services version, nor the other one that is to be
obsoleted soon.
--
Sincerely,

James Burkart
*925.667.7175*

part 2 16849 bytes content-type:application/x-zip-compressed; name="mycode.zip" (decode)

part 3 197 bytes content-type:text/plain; name="ATT00001.txt"
(decoded base64)

--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist

2019\10\19@181007 by Mike

picon face

Do you have pull-up resistors on both SCL and SDA?  Have you configured
the ANSELC register to disable analog input in RC7?

Using the TRIS register to switch a pin between an input, or an output
with a logic 0 level set is a common way of simulating an open-drain
output if this function is not support in hardware. The code you used
was very likely written for an old 14 bit part (16C/16Fxx etc.) which
don't have open-drain outputs.

Regards

Mike

On 19/10/2019 22:49, James Burkart wrote:
{Quote hidden}

--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist

2019\10\19@182025 by Isaac Marino Bavaresco

picon face
part 1 1396 bytes content-type:text/plain; charset="utf-8" (decoded base64)

James,

Check my code in the attachment.

The hardware-dependent part is for an ATSAM3A8C (ARM Cortex-M3 at 84 MHz).

Cheers,

Isaac


Em 19/10/2019 18:49, James Burkart escreveu:
> I wrote up a bit-bang I2C routine to communicate with a couple devices, an
> SSD1306 OLED and an MCP23018 port extender. I'm using a PIC18F27K40.
>
> I've got the sending data part just fine, but I can't figure out the
> receiving part, including reading acknowledge bits. I, in large, copied the
> code example from a blog post by Calvin Cherry (
> calcium3000.wordpress.com/2016/08/19/i2c-bit-banging-tutorial-part-i/
> ).
> To be honest, the way he was switching SDA between an input and output was
> confusing to me and so I just enabled open drain on the port pins in
> question. And that's why I can write to the I2C bus just fine, but reading
> from it I am stumbling. For my bit read function I change the port pin used
> for SDA to an input and read its value through PORTCbits.RC7 but it's
> always reading 0.
>
> I'd like to use the hardware I2C but I can't get the MCC code to work,
> either the Foundation Services version, nor the other one that is to be
> obsoleted soon.
> --
> Sincerely,
>
> James Burkart
> *925.667.7175*
>


--
Este email foi escaneado pelo Avast antivĂ­rus.
https://www.avast.com/antivirus

part 2 1116 bytes content-type:text/plain; name="I2C.h"
(decoded base64)

/*============================================================================*/
/*
Copyright (c) 2005-2018, Isaac Marino Bavaresco
All rights reserved
isaacbavarescoSTOPspamspamspam_OUTyahoo.com.br
*/
/*============================================================================*/
#if                        !defined __I2C_H__
/*============================================================================*/
#define __I2C_H__
/*============================================================================*/
#define I2C1    1
#define I2C2    2
/*============================================================================*/
void                        vI2CInit                ( int module );
void                        vI2CSendStart        ( int module );
void                        vI2CRepeatStart        ( int module );
void                        vI2CSendStop        ( int module );
unsigned short        uI2CSendByte        ( int module, unsigned char value );
unsigned short        uI2CReadByte        ( int module, unsigned char ack );
/*============================================================================*/
#endif        /*        !defined __I2C_H__ */
/*============================================================================*/

part 3 5302 bytes content-type:text/plain; name="I2C.c"
(decoded base64)

/*============================================================================*/
/*
Copyright (c) 2005-2018, Isaac Marino Bavaresco
All rights reserved
spamBeGoneisaacbavarescoSTOPspamspamEraseMEyahoo.com.br
*/
/*============================================================================*/
#include "pio.h"
#include "I2C.h"
#include "delay-imb.h"
/*============================================================================*/
/*============================================================================*/
/*============================================================================*/
/*============================================================================*/
/*

BOARD-DEPENDENT PART

Change only if your I/O pins are different

*/
/*============================================================================*/
#define        SCL_PORT                        PIOA
#define        SCL_BIT                                18

#define        SDA_PORT                        PIOA
#define        SDA_BIT                                17
/*============================================================================*/
/*============================================================================*/
/*============================================================================*/
/*============================================================================*/

#define        PASTE2B(a,b)                a##b
#define        PASTE2(a,b)                        PASTE2B(a,b)

/*============================================================================*/
/*============================================================================*/
/*============================================================================*/
/*============================================================================*/
/*

PROCESSOR-DEPENDENT PART

Change only if your processor uses different way of manipulating I/O

*/
/*============================================================================*/
/*============================================================================*/
#define        SCL_MASK                        (1<
#define        SDA_MASK                        (1< /*============================================================================*/
#define        SCLSetAsOutput()        (SCL_PORT->PIO_MDER=SCL_MASK,SCL_PORT->PIO_SODR=SCL_MASK,SCL_PORT->PIO_OER=SCL_MASK)
#define        SCLSetOutput()                (SCL_PORT->PIO_SODR=SCL_MASK)
#define        SCLClearOutput()        (SCL_PORT->PIO_CODR=SCL_MASK)
#define        SCLSetValue(v)                (((v)==0)?(SCL_PORT->PIO_CODR=SCL_MASK):(SCL_PORT->PIO_SODR=SCL_MASK))
#define        SCLQueryOutput()        ((SCL_PORT->PIO_ODSR>>SCL_BIT)&0x00000001)
#define        SCLQueryPin()                ((SCL_PORT->PIO_PDSR>>SCL_BIT)&0x00000001)

#define        SDASetAsOutput()        (SDA_PORT->PIO_MDER=SDA_MASK,SDA_PORT->PIO_SODR=SDA_MASK,SDA_PORT->PIO_OER=SDA_MASK)
#define        SDASetOutput()                (SDA_PORT->PIO_SODR=SDA_MASK)
#define        SDAClearOutput()        (SDA_PORT->PIO_CODR=SDA_MASK)
#define        SDASetValue(v)                (((v)==0)?(SDA_PORT->PIO_CODR=SDA_MASK):(SDA_PORT->PIO_SODR=SDA_MASK))
#define        SDAQueryOutput()        ((SDA_PORT->PIO_ODSR>>SDA_BIT)&0x00000001)
#define        SDAQueryPin()                ((SDA_PORT->PIO_PDSR>>SDA_BIT)&0x00000001)
/*============================================================================*/
#define        Delay_us(t)                        delay_333ns(3*t)
/*============================================================================*/
/*============================================================================*/
/*============================================================================*/
/*============================================================================*/


/*============================================================================*/
void vI2CInit( int module )
       {
       SCLSetAsOutput();
       SDASetAsOutput();
       }
/*============================================================================*/
void vI2CSendStart( int module )
       {
       if( SDAQueryOutput() == 0 )
               {
               Delay_us( 2 );
               SDASetOutput();
               }

       if( SCLQueryOutput() == 0 )
               {
               Delay_us( 2 );
               SCLSetOutput();
               }

       Delay_us( 2 );
       SDAClearOutput();
       Delay_us( 2 );
       SCLClearOutput();
       Delay_us( 2 );
       }
/*============================================================================*/
void vI2CSendStop( int module )
       {
       SCLClearOutput();
       SDAClearOutput();

       Delay_us( 2 );
       SCLSetOutput();
       Delay_us( 2 );
       SDASetOutput();
       Delay_us( 2 );
       }
/*============================================================================*/
unsigned short uI2CSendByte( int module, unsigned char value )
       {
       unsigned i;

       for( i = 8; i; value <<= 1, i-- )
               {
               SDASetValue( value & 0x80 );
               Delay_us( 2 );
               SCLSetOutput();
               Delay_us( 2 );
               SCLClearOutput();
               Delay_us( 2 );
               }

       SDASetOutput();
       Delay_us( 2 );
       SCLSetOutput();
       Delay_us( 2 );

       i                = SDAQueryPin();

       SCLClearOutput();

       return i;
       }
/*============================================================================*/
unsigned short uI2CReadByte( int module, unsigned char ack )
       {
       unsigned                i;
       unsigned char        value;

       for( i = 8, value = 0; i; i-- )
               {
               Delay_us( 2 );
               SCLSetOutput();
               Delay_us( 2 );

               value        = ( value << 1 ) | SDAQueryPin();

               SCLClearOutput();
               }

       SDASetValue( ack );
       Delay_us( 2 );
       SCLSetOutput();
       Delay_us( 2 );
       SCLClearOutput();
       SDASetOutput();

       return value;
       }
/*============================================================================*/

part 4 1041 bytes content-type:text/plain; name="RTC.h"
(decoded base64)

/*============================================================================*/
/*
Copyright (c) 2005-2018, Isaac Marino Bavaresco
All rights reserved
KILLspamisaacbavarescospamBeGonespamyahoo.com.br
*/
/*============================================================================*/
#if                        !defined __RTC_H__
/*============================================================================*/
#define __RTC_H__
/*============================================================================*/
void                        RTCInit                        ( void );
unsigned short        RTCWrite                ( unsigned char *Buffer, unsigned char Address, unsigned char Length );
unsigned short        RTCRead                        ( unsigned char *Buffer, unsigned char Address, unsigned char Length );
unsigned short        ReadClock                ( unsigned char *p );
unsigned short        AdjustClock                ( unsigned char *p );
/*============================================================================*/
#endif        /*        !defined __RTC_H__ */
/*============================================================================*/

part 5 2997 bytes content-type:text/plain; name="RTC.c" (decode)

part 6 197 bytes content-type:text/plain; name="ATT00001.txt" (decode)

2019\10\19@182122 by James Burkart

flavicon
face
I am using pull up resistors on both SCL and SDA. Analog is disabled on
RC7. The author of the original code mentions that he wrote the code to be
as universal as possible. I understand the reasoning, it's just
implementing it that's giving me issue. So I re wrote the code and am using
the open drain feature of my micro on SDA and SCL. But now I'm trying to
successfully read from SDA.

On Sat, Oct 19, 2019, 4:13 PM Mike <EraseMEpic.developerspamEraseMEgmail.com> wrote:

{Quote hidden}

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\20@060714 by Joep Suijs

picon face
Hi James,

The slave hold the clock low to hold off the master when it needs time. So
after the master 'releases' the clock to go high, it needs to wait until
the clock line actually is high before it can proceed. This is also the
reason you shouldn't drive clock high, only low...

Joep

Op zo 20 okt. 2019 om 00:23 schreef James Burkart <@spam@james@spam@spamspam_OUTburkartstudios.com
{Quote hidden}

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\21@003908 by James Burkart

flavicon
face
Thanks Joep,

I appreciate the help. I do understand how I2C works, my questions are
about my code. The port pins I am using for clock and data are operating as
open drain, so I'm not driving anything high.

--
Sincerely,

James Burkart
*925.667.7175*


On Sun, Oct 20, 2019 at 4:11 AM Joep Suijs <.....jsuijsspam_OUTspamgmail.com> wrote:

{Quote hidden}

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\21@010236 by Joep Suijs

picon face
Hi James,

I did check your code and didn't see where it actually checks for the clock
to go high (that is, read input and check it, not fixed delay). Didn't
check all of your code though, so I might have missed it.

Good luck.
Joep

Op ma 21 okt. 2019 om 06:44 schreef James Burkart <.....jamesspamRemoveMEburkartstudios.com
{Quote hidden}

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\21@025545 by James Burkart

flavicon
face
I haven't got to the clock stretching yet. I'm still just working on
reading the I2C bus.
--
Sincerely,

James Burkart
*925.667.7175*


On Sun, Oct 20, 2019 at 11:12 PM Joep Suijs <jsuijsEraseMEspamgmail.com> wrote:

{Quote hidden}

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\21@033634 by Joep Suijs

picon face
The slave is allowed to strech the clock.
I once had trouble with i2c software master code reading a slave. It turned
out the slave used clock streching to setup data requested by the master.
The master didn't check the clock though, and read rubbish while the slave
was still busy preparing the requested data...

Joep

Op ma 21 okt. 2019 om 09:00 schreef James Burkart <spamBeGonejamesEraseMEspamburkartstudios.com
{Quote hidden}

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\21@041830 by Chris Roper

picon face
If you have a PICKit 2 or 3 you can use the GUI as a crude Logic
analyzer that will allow you to see your SLC and SDA lines and look at the
response and timing. It is a very useful and oft overlooked tool for this
sort of debugging.

On Mon, 21 Oct 2019 at 09:41, Joep Suijs <jsuijsEraseMEspam@spam@gmail.com> wrote:

{Quote hidden}

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\21@050303 by James Burkart

flavicon
face
I saw that. I do have a logic analyzer I'm using to debug.

I gave up on my soft i2c code and I am earnestly trying to figure out how
to use the mcc foundation services simple i2c drivers. The reason I ditched
it before is because it was slow. There was a long pause between every byte
written and read. But I just dug into the driver and found where the delay
is and shortened it some. It's acceptable now.

The delay is in a function labeled inline void mssp_waitForEvent(uint16_t
*timeout)

There was a 100us delay located in a while loop that's checking for an
interrupt flag to set. If someone knows why it's even there, I'm all ears.
In the meantime, I'm moving on though I've noted where I made the change in
case something gets wonky in the future. I'll eventually dig deeper to
understand the driver more.

On Mon, Oct 21, 2019, 2:23 AM Chris Roper <.....caroperspamRemoveMEgmail.com> wrote:

{Quote hidden}

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\21@065305 by Jason White

picon face
If things still are not working you ought to post some waveforms of the
device's i2c read request and response. Chances are that it would be easy
to see what the problem is from that information (eg. Pull ups too weak,
incorrect clock stretching, wrong clock rate, etc.)

On Monday, October 21, 2019, James Burkart <jamesspam_OUTspamburkartstudios.com> wrote:

{Quote hidden}

-- Jason White
-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\28@134721 by James Burkart

flavicon
face
OK, so update. Amazingly I stumbled across an online forum run by the
person who wrote the MCC Foundation I2C driver. At first they were
optimistic they could help me with getting it to work properly.

A little background. I am able to successfully read and write to an I2C
slave device. The problem is when there is a NACK such as when the slave
you are requesting isn't present on the bus. The driver doesn't handle it
properly, it goes into an endless loop.

So we have been going back and forth with some code changes, and as it
stands, the person realizes there are some bugs, but unfortunately they do
not have the time at the moment to debug the code. They gave me some
suggestions on things to try, buy my knowledge in C and specifically the
workings of this driver, are not very good. I am in over my head, but I
need to get this to work, or else I'm back to writing my own bit-bang
driver.

If any of you are interested, here is my thread on the forum:
https://www.microforum.cc/topic/90-help-with-mcc-generated-i2csimple-getting-stuck-in-a-loop/

--
Sincerely,

James Burkart
*925.667.7175*


On Mon, Oct 21, 2019 at 4:59 AM Jason White <
KILLspamwhitewaterssoftwareinfospamBeGonespamgmail.com> wrote:

{Quote hidden}

--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\28@141221 by Nicola Perotto

picon face

Hi James,
can you share also your "flow chart" of the algorithm?
     Nic



On 28/10/2019 18:46, James Burkart wrote:
{Quote hidden}

--

Nicola Perotto - NP Engineering
Sistemi Informatici ed Elettronici
skype: nicolap
mob IT: +39 335 7162 582
mob HU: +36 30 417 3780
tel: +39 06 916 502 732
fax: +39 0439 633 1191

--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist

2019\10\28@143556 by James Burkart

flavicon
face
I'm not sure what you're asking for. I don't have a flow chart, as it is
the MCC generated code. It is also quite complex and I'm just barely good
enough to step through the code trying to debug it.

--
Sincerely,

James Burkart
*925.667.7175*


On Mon, Oct 28, 2019 at 12:15 PM Nicola Perotto <RemoveMEnicolaKILLspamspamRemoveMEnicolaperotto.it>
wrote:

{Quote hidden}

--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\28@145745 by Nicola Perotto

picon face



On 28/10/2019 19:34, James Burkart wrote:
> I'm not sure what you're asking for.

> I don't have a flow chart, as it is
I already know...  ;-)

> the MCC generated code. It is also quite complex and I'm just barely good
> enough to step through the code trying to debug it.
If the code is complex you NEED some kind of "flow chart" (I used quotes...).
It has not to be "canonical"  nor complete but drawing a scheme of what you are
trying to do is very useful :-)
    Nic

--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist

2019\10\28@150938 by James Burkart

flavicon
face
What I need is a well commented driver that doesn't have bugs that renders
it almost useless.

--
Sincerely,

James Burkart
*925.667.7175*


On Mon, Oct 28, 2019 at 1:00 PM Nicola Perotto <spam_OUTnicolaspamTakeThisOuTnicolaperotto.it>
wrote:

{Quote hidden}

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\28@163438 by Forrest Christian (List Account) n/a

flavicon
face
Have you considered just throwing away the driver and manipulating the i2c
peripheral directly?

The datasheet typically has enough data for one with modest coding skills
to write a serviceable chunk of code.   I've learned over the years that
often for comms and i/o it is better to just ignore the drivers and go
after the device directly, as the driver often makes assumptions which are
not relevant to your specific situation.

On Mon, Oct 28, 2019 at 1:18 PM James Burkart <.....james.....spamRemoveMEburkartstudios.com>
wrote:

{Quote hidden}

-- - Forrest
-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\28@164135 by David Van Horn

flavicon
face
I've found it usually took less effort to write my own drivers from scratch than to figure out someone's library docs.   I just did that for GPS parsing in Arduino last weekend, and I'm doing it for a SPI ADC chip now.   I've also found that my drivers tend to be smaller and faster than the typical libraries.
--
David VanHorn
Lead Hardware Engineer

Backcountry Access, Inc.
2820 Wilderness Pl, Unit H
Boulder, CO  80301 USA
phone: 303-417-1345  x110
email: EraseMEdavid.vanhornspamBeGonespamKILLspambackcountryaccess.com 

{Original Message removed}

2019\10\28@164232 by Jason White

picon face
I agree, drivers often are only a starting point. In the vast majority of
applications I have encountered it has always been better* in the long run
to "roll your own" driver if time permits.

*As in fewer bugs, faster/smaller code, and better conceptual clarity and
compatibility with the end use

On Monday, October 28, 2019, Forrest Christian (List Account) <
RemoveMElistsspamBeGonespamspampacketflux.com> wrote:

{Quote hidden}

-- Jason White
-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\28@182215 by James Burkart

flavicon
face
I've considered it, but I'm intimidated. I'm not sure I would describe my
coding skills as moderate. I was barely getting by writing a software I2C
driver.

--
Sincerely,

James Burkart
*925.667.7175*


On Mon, Oct 28, 2019 at 2:38 PM Forrest Christian (List Account) <
.....listsRemoveMEspampacketflux.com> wrote:

{Quote hidden}

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\29@045535 by John Sanderson

flavicon
face
Hello James & piclisters,

BTDT.
I had an epic struggle a couple of years ago doing something

---
New Outlook Express and Windows Live Mail replacement - get it here:
https://www.oeclassic.com/

parallel.

Setup was (from memory):-

PIC32 running micromite Basic, used as I2C master.
PIC16f1826 running MPASM and used as I2C slave, to receive and transmit data.

Everything worked fine except getting the 16f1826 slave to comms properly,
I think data receipt from the slave was the real stumble, and I was using the in-built mssp. I only made headway, and quickly, when I ditched my old crude logic analyser and set myself up with:-

Salae clone 8ch FX2LAFW.
Sigrok's Pulseview running on my PC. - that in itself was 'challenging' but so well
worth it. Decoder stacker makes all the difference.

The whole thing was sorted so neatly once I had the right stuff, and it wasn't
'expensive', just needed to figger out what the hell I was doing.

Imagine flying in cloud without any artificial horizon or instruments (deadly),
then doing it with a full panel. Night and day.
It's doable, best of luck.


   bestos,   John

{Original Message removed}

2019\10\29@055402 by Alan Pearce - UKRI STFC

face picon face
> Have you considered just throwing away the driver and manipulating the i2c peripheral directly?
>
> The datasheet typically has enough data for one with modest coding skills
> to write a serviceable chunk of code.   I've learned over the years that
> often for comms and i/o it is better to just ignore the drivers and go after the device directly,
>  as the driver often makes assumptions which are not relevant to your specific situation.

Check out AN734 (Slave mode) and AN735 (Master mode) application notes from Microchip. I used these successfully with PIC16F876 devices to make an I2C system. They are in assembly, and IIRC the AN735 code has a bug, but I have the details if you wish to use it. The code as listed is downloadable with the app note.

I successfully modified them to use interrupts, using an early version of Olins template system, and could find the code for you if needed.

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\30@040745 by Clint Jay

picon face
I used those app notes and the relevant datasheets for the micro and I2C
device to create my own C code to run I2C devices like the DS1307, it's not
particularly difficult.

As Olin is famous for saying, it's all in the datasheets.

I'd recommend getting a copy of the Phillips/NXP I2C documents as a guide
to the protocol too.

On Tue, 29 Oct 2019, 09:55 Alan Pearce - UKRI STFC, <
RemoveMEalan.b.pearcespamspamSTOPspamstfc.ac.uk> wrote:

{Quote hidden}

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\30@051217 by James Burkart

flavicon
face
I've got the protocol down pretty solid. It's making the hardware work on
the micro side. I am definitely employing the datasheet of the 18F27K40.
--
Sincerely,

James Burkart
*925.667.7175*


On Wed, Oct 30, 2019 at 2:11 AM Clint Jay <.....cjaysharpEraseMEspamgmail.com> wrote:

{Quote hidden}

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\30@190046 by Stephen Forrest

picon face
Hi James -
Did you check the Errata documents? There are a number of issues with
master mode I2C documented there for this chip (to the extent of " Master
mode not functional" on original silicon) One of these may affect the
driver you are using...

Stephen


On Wed, Oct 30, 2019 at 8:14 PM James Burkart <.....jamesEraseMEspamburkartstudios.com>
wrote:

{Quote hidden}

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\31@063219 by James Burkart

flavicon
face
I didn't think to look. I'll definitely check them out! Thanks!
--
Sincerely,

James Burkart
*925.667.7175*


On Wed, Oct 30, 2019 at 5:03 PM Stephen Forrest <spamBeGonesforrest.auspamBeGonespam@spam@gmail.com>
wrote:

{Quote hidden}

-- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist
.

2019\10\31@230854 by John Ferrell

face
flavicon
face

You are better than you think! Try a few simple examples and you may
find your efforts faster, better documented and easier in the long run.

On 10/28/2019 6:21 PM, James Burkart wrote:
> I've considered it, but I'm intimidated. I'm not sure I would describe my
> coding skills as moderate. I was barely getting by writing a software I2C
> driver.
>
> --
> Sincerely,
>
> James Burkart
> *925.667.7175*

--
John Ferrell de W8CCW
“It is never too late to give up your prejudices.”  ~  Henry David Thoreau

--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
mailman.mit.edu/mailman/listinfo/piclist

More... (looser matching)
- Last day of these posts
- In 2019 , 2020 only
- Today
- New search...