Go Down

Topic: Disabling UART on Due? (Read 3 times) previous topic - next topic

tuxduino


Ouch, my missunderstanding too i guess  :P

Anyway code is not mine, im just modding it to do some other stuff, but that's the part i need to get working.

If you want to see the full project for the code i have posted, you can find it here:

http://code.google.com/p/opengauge/wiki/OBDuino

BR


Hey, that's a nice project! Think I've googled you up a couple years ago :P

Getting some data off that OBD connector hidden somewhere under my steering wheel is one of the things I'd like to do sooner or later... Just bookmarked your project :)

Bi0H4z4rD

Thanx for the reply! That code/project is not mine, i am using parts of its code to do some other stuff, like reading ecu sw info and other service operations.

Anyway, i found some bugs in that code which are now corrected (and tested) and enable fast init, aswell as the bitbang for a more standard 9600bps communication speed instead of 10400bps.

Just for the record:



Uploaded with ImageShack.us

BR

stimmer

The SAM3X has registers PIO_PER and PIO_PDR which control whether a pin is used as a digital output or by a peripheral:

g_APinDescription[pin].pPort -> PIO_PER = g_APinDescription[pin].ulPin;  (pin is digital io)
g_APinDescription[pin].pPort -> PIO_PDR = g_APinDescription[pin].ulPin;  (pin is peripheral)

Posting this in the hope that it just works - if it does, great, if not then you're probably going to need to study the datasheet.

Bi0H4z4rD

Thanks stimmer, will definitely try this out and post results as soon as i do it.

BR

aethaniel

hi Bi0H4z4rD,

sorry for late reply on this but yes, you should use what stimmer suggested you. This is the only way to assign a pin either to GPIO multiplexing or to a peripheral.

by the way, if you want to send 5bit frames, maybe are you able use the USART with the proper configuration. That way you won't have to do it manually:

36.2 Embedded Characteristics
• Programmable Baud Rate Generator
• 5- to 9-bit Full-duplex Synchronous or Asynchronous Serial Communications

I didn't check deeply the DS, so maybe am I wrong.

Go Up