Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 38
61  Using Arduino / Programming Questions / Re: SoftwareSerial problem , but only on 1284p on: December 24, 2013, 04:09:48 pm
Ahhhh, sorry!

My wiring_analog.c file has a custom patch on analogRead to allow control of sample hold capacitor charging time for use with High Z input source. This is because I use a 2M/1.5M divider to minimise leakage current on a voltage monitoring circuit.

It adds a second argument for an additional delay in microseconds, I.e analogRead(A0, 250) would introduce a 250uS delay to allow capacitor to charge properly. It's a trick I picked up from another thread here from Nick and someone else. ;-)

So, have you tested Software Serial on all 1284P pins except D0 and D1 and they are all good?  That would be great if you can confirm.

My board doesn't have the pin numbers on it as everything comes to custom headers to just plug specific expansion modules in. I have to cross check against my pin assignment spreadsheet.

Maybe CrossRoads could do a double check on an actual Bobuino board?
62  Using Arduino / General Electronics / Re: Reverse Matrix Keypad on: December 24, 2013, 06:30:51 am
Can you wire up the original matrix keypad and see what the output is like from that?

What you are describing would logically suggest that a keypress down/up should be interpreted the same.

There must be some debouncing in there somewhere for the manual keypad. You wouldn't need that with transistor switching as it is a clean on/off, unlike a mechanical switch.

If you can scope the button press then *maybe* it might actually be a case of simulating bounce with the transistor. Since we don't have acccess to the code reading the "keypad" it's going to be a measure of guesswork.
63  Using Arduino / Programming Questions / Re: SoftwareSerial problem , but only on 1284p on: December 23, 2013, 08:13:34 pm
Well, the compiles with soft serial now.

Will work on it more later for the LCD dispaly.

Any idea about the  INPUT_PULLUP issue (I know different problem) but it is a core issue.

Thanks

The two attached files should fix the INPUT_PULLUP issue for maniacbug core.

Back up your originals first as I make no warranties or guarantees on my code as I'm just an amateur. ;-)
64  Using Arduino / Networking, Protocols, and Devices / Re: Creating a star network? on: December 23, 2013, 05:54:08 pm
Take a look at this also - http://maniacbug.wordpress.com/2011/11/02/getting-started-rf24/
65  Using Arduino / General Electronics / Re: Reverse Matrix Keypad on: December 23, 2013, 05:18:30 pm
Have you got a schematic of how you've wired it up?

How long are you turning the transistor on for , to simulate a keypress?
66  Using Arduino / Programming Questions / Re: SoftwareSerial problem , but only on 1284p on: December 23, 2013, 05:09:27 pm
Right, I'm feeling a bit chuffed at the moment as I've managed to get Software Serial working on my 1284P board with Bobuino pin mapping.

This is experimental as all I've done is hunt through lots of different examples for various 644/1284 pin maps and try and work out some logic.

I'd appreciate anyone else testing his, but please back up your original Bobuino pins_arduino.h files, or at least the bits you change.

Original lines

Code:
#define digitalPinToPCICR(p)    ifpin(p,&PCICR,(uint8_t *)0)
#define digitalPinToPCICRbit(p) ifpin(p,digital_pin_to_pcint[p] >> 3,(uint8_t *)0)
#define digitalPinToPCMSK(p)    ifpin(p,__pcmsk[digital_pin_to_pcint[]],(uint8_t *)0)
#define digitalPinToPCMSKbit(p) ifpin(p,digital_pin_to_pcint[p] & 0x7,(uint8_t *)0)

Replacement lines

Code:
#define digitalPinToPCICR(p)    ifpin(p,&PCICR,(uint8_t *)0)
#define digitalPinToPCICRbit(p) ifpin(p,digital_pin_to_pcint[p] >> 3, 0)
#define digitalPinToPCMSK(p)    (((p) <= 3) ? (&PCMSK3) : (((p) <= 7) ? (&PCMSK1) : (((p) <= 9) ? (&PCMSK3) : (((p) <= 13) ? (&PCMSK1) : (((p) <= 21) ? (&PCMSK0) : (((p) <= 29) ? (&PCMSK2) : (((p) <= 31) ? (&PCMSK3) : ((uint8_t *)0))))))))
#define digitalPinToPCMSKbit(p) ifpin(p,digital_pin_to_pcint[p] & 0x7, 0)

I'd also appreciate someone double checking my listing for the PCINT to Digital Pins below, as this is how I constructed the digitalPinToPCMSK(p) #define above. It is working for me with RX on 24 and TX on 21. Trying different combinations would be good to see if it works with other pins OK.

Code:
PCINT 7-0       PCMSK0       D14-D21
PCINT 15-8      PCMSK1       D4-D7, D10-D13
PCINT 23-16     PCMSK2       D29-D22
PCINT 31-24     PCMSK3       D0-D3, D8-D9, D30-D31

Software Serial is Pin Change Interrupt driven and uses direct port  manipulation, but it looks like it gets the port/bit info from the pin mapping. I.e when you give it the pin numbers it has to convert to the relevant direct port/bits to control the correct hardware pins etc.
67  Using Arduino / Programming Questions / Re: Set all LOW digitalWrite on: December 23, 2013, 08:54:38 am
Just another loop, just like the one you have there, but setting LOW and with no delay. One loop inside another.

Of course, you could just set all LOW once in setup and then sequentially turn each one on, delay, then turn it off again and loop round to the next one.

Put a loop in setup and you can set each pinmode and set off in one go. After that turn one on, then off and you'll achieve your sequence.
68  Using Arduino / General Electronics / Re: Reverse Matrix Keypad on: December 23, 2013, 08:40:32 am
So you basically want to simulate the keypad from the Arduino?

The first thing that springs to mind is to do just that. Recreate the matrix using transistors or mosfets for the switches and then have 12 arduino pins controlling them, instead of your fingers.

Just neednto make sure any Arduino 'press' is long enough in duration to replicate a human press and give the scanning routine time to see it as it scans the rows and colums on the matrix.

You'd have to set a test up to see if it would work, but I think it may do.

If you can't afford 12 pins then you could control the transistor bases via a couple of 595 shift registers. You could just have a value that corresponds to the shift register output for a particular key 'press' and then ShiftOut the high and low byte to enact.
69  Using Arduino / Networking, Protocols, and Devices / Re: [SOLVED] Problem Synchronizing micros() Between Two Arduinos on: December 23, 2013, 05:47:40 am
You can probably reduce the drift rate by making sure you are using crystal, rather than oscillators.

If all units are in close proximity then daisy chaining the clock signal, as stated above, is an option. If they are physically separated then your reync code could be easily modified to work over RF, although you might need to factor in an adjustment for the send/receive times.
70  Using Arduino / Programming Questions / Re: How to program an ATMEGA328 or ATMEGA328P on: December 23, 2013, 05:37:20 am
71  Using Arduino / Installation & Troubleshooting / Re: Confusing Due Compilation Issue *solved* on: December 23, 2013, 04:33:35 am
For multiple sets of axes then a better way would be to use arrays.

For n sets of axes then declare x[n] and y[n] and then use x[0], x[1].........

You could then use a single function for many things, where you just pass in the axis set number and re-use the same code over and over.
72  Using Arduino / Programming Questions / Re: Am I dooing it right? Outputting dc voltage on a LCD on: December 23, 2013, 04:21:01 am
What value resistors are you using for your divider?
73  Using Arduino / Networking, Protocols, and Devices / Re: Creating a star network? on: December 23, 2013, 04:11:00 am
If you look at RF24Network library, that actually implements a Tree network, but the Base Node (00) and first 5 Childs (01-05) effectively make a 6 node Star network. This is because there are 6 Pipes available in the nRF24L01(+) .

Because each successive layer keeps 1 pipe for communication to it's Parent, it leaves 5 pipes for Child nodes.

In that same model then you could actually have 6 nodes from the base, but RF24Network drops additional one at the Base Node to keep everything consistent.

How many nodes do you need in your network? If you need 5 or less then maybe RF24Network will do what you need.
74  Using Arduino / Networking, Protocols, and Devices / Re: Problem Synchronizing micros() Between Two Arduinos on: December 22, 2013, 08:39:08 pm
Millis() won't run at exactly the same speed on every device. Crystals will have slightly different tolerances, temperature will introduce errors etc.

If you want to keep them in sync then you will need to periodically re-sync with your 'master'. How often will depend on the rate of drift and what tolerance you place on total drift before resync.
75  Using Arduino / Programming Questions / Re: SoftwareSerial problem , but only on 1284p on: December 22, 2013, 07:53:16 pm
I'm hitting the same problem now. I am already using both hardware serial ports and need to use Software Serial and I have the same errors due to issues with the Bobuino pin map. If I try compiling with the AVR Developers pin map it works fine.

I found a reference to the Calunium board and a fix , but it doesn't cure my issue with Bobuino map.

I've tried comparing pin maps for different 1284 versions and against the standard Uno but it's out of my league to understand all the clever jiggery pokery.

It would be great if one of the more talented programmers could take a look and try and fix this to get Software Serial working on 644/1284.

I'm willing to donate a 644 if there is someone that needs the hardware to test on.
Pages: 1 ... 3 4 [5] 6 7 ... 38