Welcome to the E-blocks forum

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Ian
Posts: 110
Joined: Thu Sep 29, 2005 10:53 am
Location: Matrix Multimedia
Been thanked: 1 time
Contact:

Welcome to the E-blocks forum

Post by Ian »

Welcome to the E-blocks forum.

This forum is for E-blocks users to discuss projects and issues relating to E-blocks.

Please feel free to discuss raise questions, make comments and suggestions, and to discuss ways of working with E-blocks.
Or just chat about E-blocks in general.

The usual caveats apply: Please be civil, and no posting spam, abusive or nasty posts etc.

Thanks and enjoy the forum.

PUTS_JO
Posts: 20
Joined: Wed Sep 01, 2010 8:11 am
Has thanked: 1 time
Contact:

Re: Welcome to the E-blocks forum

Post by PUTS_JO »

Hi,
I am a brand new user of e-blocks and before i used a programmer and a breadboard with a lot of wires.
I use a 18f4455 pic controller to get just a test text on the screen but this is not working.
when i simulate my test program it is ok.
is someone able to help me out of this never working story?
thanks

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Welcome to the E-blocks forum

Post by Benj »

Hello,

The problem is likely due to your configuration settings or maybe your clock speed if you are using Flowcode. Have you checked that these are correct for your hardware?

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Welcome to the E-blocks forum

Post by medelec35 »

I totally agree with Ben, it will be the configuration settings.
If you are still struggling after checking configuration settings, If post your flowchart, and let us know the speed of the crystal you are using and Version of Flowcode, then we can help you further.
Martin

PUTS_JO
Posts: 20
Joined: Wed Sep 01, 2010 8:11 am
Has thanked: 1 time
Contact:

Re: Welcome to the E-blocks forum

Post by PUTS_JO »

BEST BEN & MEDELEC35
As I told before I am also new in using this forum. I have bought the complete set of e blocks together. so at the moment for getting familiar
with flowcode 4 and the new EB0006 development print I have build and compiled a small program called 'papa20' just to test my first text on a screen.(at this moment i do not know how i can send my program to you)
I am using an 18f4455 because I followed a course 1year ago from the formula flowcode robot and I think I am more familiar using this IC.
I changed already the xtal oscillator to a 4Mhz on the EB0006 print because in the Chip configurations of the 18f4455 i can only select an external
xtal of 4mhz.
when transferring the compiled and builded data to the EB board i see a led flashing and i get no errors on the screen .

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Welcome to the E-blocks forum

Post by medelec35 »

PUTS_JO wrote:at this moment i do not know how i can send my program to you.
To upload a file to this forum, Click 'POSTREPLY' and type message as you normally would do.
then
Click Upload attachment tab
Click 'Browse', then a new window will appear.
Within that window Browse to your Flowchart.fcf file
Click 'Add the file'
then click 'Submit'
Martin

PUTS_JO
Posts: 20
Joined: Wed Sep 01, 2010 8:11 am
Has thanked: 1 time
Contact:

Re: Welcome to the E-blocks forum

Post by PUTS_JO »

BEST MEDELEC35
HERE IS MY PROGRAM DATA WITH THE SETTINGS INCLUDED AS FOR NOW
Attachments
PAPA20.fcf
(5.5 KiB) Downloaded 1291 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Welcome to the E-blocks forum

Post by medelec35 »

Hello PUTS_JO
First I would change your Flowchart. If you look at the picture, I have put LCD component macro to initialise LCD after a 50ms delay.
Also you are sending text to LCD, but clearing it 50ms later.
18F4455 LDC.jpg
18F4455 LDC.jpg (79.71 KiB) Viewed 44747 times
As for not working on port A,This is an odd one!
Using EB006 Programming board ,EB005 LCD and 18F4455: I can get LCD display to work on port D, but unable to get Display working on port A!
I have checked o/p's from port A using EB004 LED board, and starting with number 1 and just x by 2 and sending result to port A. Each LED (just using LED 0 to 5) takes in turn to light up.
If some one else could see if they can get LCD to work on port A, I would be grateful, as I am getting splinters in my fingers by scratching head so much :p
Thank you.
Martin

PUTS_JO
Posts: 20
Joined: Wed Sep 01, 2010 8:11 am
Has thanked: 1 time
Contact:

Re: Welcome to the E-blocks forum

Post by PUTS_JO »

BEST MEDELEC_35

AS I COULD READ ON YOUR EXPLANATION ? IS IT FORBIDDEN TO USE AN EVEN PORT NAME FOR AN LCD OR NOT ?
I LOOKED AT THE DATASHEETS OF THE 18F4455 AND I COULD NOT FIND SOMETHING LIKE THAT OR IS THIS SOMETHING I HAVE TO KNOW?

THANKS

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Welcome to the E-blocks forum

Post by Benj »

Hello Medelec

The PortA problem on the 18F4455 is somehow due to the ADC peripheral. Try setting ADCON0 to a channel that is not on PortA and the LCD should then fire up correctly.

C Code:
adcon0 = 0x30;

Hello Puts_Jo

The LCD should work correctly on any port but some chips either do not have enough PortA pins or they have a Pin on Port A (Normally RA4) which is not able to source current. If this is the case then you can use a pull up resistor to VCC which sources the current and should fix this problem.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Welcome to the E-blocks forum

Post by medelec35 »

Benj wrote:Hello Medelec

The PortA problem on the 18F4455 is somehow due to the ADC peripheral. Try setting ADCON0 to a channel that is not on PortA and the LCD should then fire up correctly.

C Code:
adcon0 = 0x30;
Thanks Ben, You are spot on!
Now LCD is working on port A
I would not have worked that one out!
@PUTS_JO
Your configuration settings are not correct (assuimg you have a xtal of 19.66MHz of course. If xtal is different e.g . 4MHz, change value of Osc Select to no div = 4MHz etc) , I could not correct and post since could not get LCD to work in port A.
However since Ben a posted a solution, the attachment with corrected configuration settings should now work with your hardware!
Attachments
PAPA20_Modified.fcf
(5.5 KiB) Downloaded 1283 times
Martin

beejo
Posts: 31
Joined: Thu Sep 11, 2008 12:46 pm
Location: TheNetherlands
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: How can I make an PIC RS232 controller in Flowcode 4?

Post by beejo »

Hello,
I want to make a RS232 controller in Flowcode 4 with a PIC between a 3 wire (TX,RX,Ground) RS232 device "Host" and another 3 wire RS232 device "Client".
The host have to communicate with the Client and give some actions commands. And the PIC have to filter the data string for commands to control two Servo motors.
So when i am right i need two RS232 connections one for the connection to the Host and the PIC controller and one for the connection to the Client and the PIC.

Is this possible with the MAX 202 (Because I see two RX and two TX lines on this product) or do i need an Pic processor with 2 USARTS or can I use an EB015 block? And if so how do I have to connect the EB015?
Who can help me ?
Beejo.

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: Welcome to the E-blocks forum

Post by JUZAR »

Hi,

I have recently purchased Flowcode 6.1.3.2 and Eblock EB006-00-9. I am new to flow code and stuck up with Eblock. I have mounted PIC16f684 on 20 pin socked of Eblock. When trying to detect the chip using Mloader program it is giving error Attempting to detect chip...
Unable to communicate with target: Kindly help how to solve this issue.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Welcome to the E-blocks forum

Post by medelec35 »

Hi JUZAR,
Have you tried the latest drivers from here
Does the Device manager show EB006 Multiprogrammer?
Martin

EtsDriver
Posts: 444
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 345 times
Been thanked: 227 times
Contact:

Re: Welcome to the E-blocks forum

Post by EtsDriver »

Hello JUZAR,
additionally to medelec35's help, check power and programming jumpers on eb006 that they are correct and in place!
Ill just keep the good work up!

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: Welcome to the E-blocks forum

Post by JUZAR »

Thanks for your prompt reply. Just found out the USB power was not sufficient to program the chip. Changed to external power and now its working OK. Checked the test software and it was sucessful

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: Welcome to the E-blocks forum

Post by JUZAR »

Hello Sirs,

Kindly see attached flowchart of LED flasher using interrupt timer. After downloading the hex file to Eblock EB-006-V9, when I try to execute the software on the chip PIC16F684, I could not see any output on Port C.3. The output is simply zero voltage and there is not HIGH / LOW signal observed on the chip pin. Can you please advise is there anything wrong or missing from my side. The chip is correctly detected by mloader program and there is no error while compiling the HEX file and also no error while programming on the chip.

Awaiting your reply at the earliest.
Attachments
TimerDemo.fcfx
(7.26 KiB) Downloaded 554 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Welcome to the E-blocks forum

Post by Benj »

Hello Juzar,

The interrupt enable icon should be placed before the while loop in the main macro. What you are doing at the moment is enabling the interrupt over and over again in a tight loop which keeps resetting it so it never fires.

The chip will also default to 4MHz rather than the 8MHz so you need to add a C icon to the very top of your main macro with the following code to put the chip in 8MHz internal oscillator mode.

Code: Select all

osccon = 0x70;
Hopefully this should solve the problem.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Welcome to the E-blocks forum

Post by medelec35 »

Hi JUZAR,
You will need to do two things to your Flowchart.
1) Move the timer interrupt to outside the main loop.
The interrupt only required access once only and not continuously.

2) Since using internal osc, you should add a c code block with a osccon value, and don't forget to place a semicolon at the end:
Timer Demo1.png
(16.83 KiB) Downloaded 20745 times
How i worked out correct osccon value can bee seen here
Code then was for 32MHz, but same principle will apply to 8MHz (or any other frequency).

Also if switching on and off a single pin you only need 1 or 0 not a value greater than 0.

so you could use:
Timer Demo2.png
(3.46 KiB) Downloaded 20743 times
Finally if MCLR is enabled. you must make sure that MCLR is pulled to +5V.
I personally use a 10K resistor so it does not affect 5V supply during programming.

Martin

Edit:
Ben beat me to it. but will leave for the additional information.
Also added pin & MCLR information.
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Welcome to the E-blocks forum

Post by Benj »

Thanks Martin, Great minds think alike :wink:

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: Welcome to the E-blocks forum

Post by JUZAR »

Thanks Benj & Medelec

Its working.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Welcome to the E-blocks forum

Post by medelec35 »

Hi Ben,
Thanks.
Yes they do , but wish my mind was as great as yours. :lol:

I have also added even more information just in case.

Your welcome JUZAR,
Two repeated answer's are far better than none.

Martin
Martin

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: Welcome to the E-blocks forum

Post by JUZAR »

Hi Sirs,

OK, once again stuck up with E-Blocks, I am generating a PWM using PIC16F684, its working fine on simulation but not working on E-Blocke with PIC16F684 mounted. The logic is as under along with attached flowchart.

1) A LED is turned ON at start of program on port A.1. ( This LED turns ON when HEX file is downloaded on E-blocke , but PWM is not working )
2) EEPROM is used to store last switch data. On the first run the program first finds out whether the last switch data is stored is saved or not by reading 101 on address 1 of EEPROM, if it is not 101 than default value 128 will be saved on address 2.
3) This 128 will be used to generate PWM with 50 % duty cycle.
4) A loop is created to detect UP and DOWN switches with it maximum and minimum limit of 200 and 100.
5) Further the last switch data is stored on the EEPROM so that in next power up the last switch data is read from address 2.

Now simulation is working OK, but when HEX file is downloaded only the LED turns on but NO PWM seen. Kindly guide me whether there is any issue with software or some configuration mistake on hardware.

Awaiting your reply at the earliest. Flowcode file is attached with this post.
Attachments
TempAVR1.fcfx
(14.34 KiB) Downloaded 539 times

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: Welcome to the E-blocks forum

Post by JUZAR »

Hi Benj / Medelec

With respect to my yesterdays post regarding PWM, today I simplified the PWM flowcode as per attachment. But still its not working. Simulation is OK but on the chip ( PIC16F684) its not showing any PWM output on the Port C.5. Kindly guide me what could be wrong. Chip is mounted on E-Block EB006V9.

Awaiting your reply at the earliest.
Attachments
pwmcode_v1 (1)_v6.fcfx
(4.22 KiB) Downloaded 542 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Welcome to the E-blocks forum

Post by medelec35 »

Hi JUZAR,
Watchdog Timer within Build, Project Options, configure is set to enable.
Can you set it to disable and try again.

Martin
Martin

Post Reply